91 Topics
| |
i was on the site pyschools working through the exercises, but i dont understand why it wont accept the code i input. [url]http://www.pyschools.com/quiz/view_question/s4-q2[/url] Create a function generateNumbers(start, end, step) that takes in three numbers as arguments and returns a list of numbers ranging from start to the end number (inclusive)and … | |
hello sir getting error when run the loop and going to last value of row count please help and i can not use the 2nd loop in the place of cells(?????) number how can i use this **Index was out of range. Must be non-negative and less than the size … | |
Hello! I have to print patterns using '*' and I am at a loss how to get these patterns printed! I figured out the first one, * ** *** **** ***** ****** ******* ******** ********* ********** and now i have to do it upside down: ********** ********* ******** ******* ****** … | |
Hi, from the result in my "for" loop, have stored four value. How to extract that value to show the value(sprintf) ? Kindly refer to the attached the image file. Thanks Regrads, nazif | |
Use Google's modern Go language (aka. golang) to convert a denary number (base 10) to a roman numeral. Just a good exercise to explore Go's map, slice, sort and for loop features. Note that in Go the **:=** is shorthand for assigning a type (by inference) and a value to … | |
Hello! I have a little problem with a For Loop, this is a For Loop in my script: $last_id = $conn->lastInsertId(); for($a = $last_id ; $a > 0 ; $a--){ code.... } But it doesn't work because of `($a = $last_id ;`, the variable $a can't be set to the … | |
Optimizing Matrix Multiplication One time consuming task is multiplying large matrices. In this post we'll look at ways to improve the speed of this process. We'll be using a square matrix, but with simple modifications the code can be adapted to any type of matrix. The straight forward way to … | |
I am trying to create a File Searching Utility that finds all Files with a given Name which searches all Folders (Sub Directories, and Sub Directories of Sub Directories) in a given Directory. I was thinking of a way to use For Loops, or For Each, but that would mean … | |
Hi, I'm new to Python and have a task of reading a user input text file that is tab-delimited and contains 4 columns in each line: Authors, Year, Title and Journal. I currently am just able to open a file, and now I don't know how to begin parsing the … | |
I need to create a 2D array that holds the number of family members by the highest numbe of titles of one of the family members, and they input on one line. However, I am having trouble when I call the class in my other code in the main method. … | |
I'm writing a program where the settings of a spreadsheet-like field of textboxes are changed using two for loops, and I can't for the life of me figure out why it's not working.I have tried declaring the txt variable and name variable in different orders using different methods, but nothing … | |
Hello everybody, I was asked by an interviewer the following question. but I was not able to answer. Please get back to me if you know the answer. thank you in advance. Que: What is the exact difference between the "for" loop and "while" loop in C language ? | |
**This is intented for learning purposes, feel free to study the code** Create a drawing that looks like this (pyramid) The number should be incremented with the modulus. | |
So I am working on a simple assignment for my C class that reads a formatted file and prints information about the file based on the format. The file format looks like this: #Domain Alexa Rank Site Name #------------ ----- ------- --------- amazon.com 13 1177136 Amazon.com google.com 1 4533883 Google … | |
I have a python code that reads several csv files and writes teh data to a single file but every time it loops back around to the next file it prints the headers again. Is there a way to stop this I can post my code if it is nessisary. | |
Hi Champs, Im using VBA for Excel. and Im trying to use the code below to move through records and increment their values by one since they meet a certain criteria Sub promotion() Dim x As Range Dim y As Integer Sheet2.Range("c2").Activate Do While y < 1002 y = ActiveCell.Row … | |
| Hey everyone, I'm doing a practice problem and I'm stuck. The question is "Given an array a of n numbers (say doubles), consider the problem of computing the average of the first i numbers, for i ranging from 0 to n-1. That is, compute the array b of length n, … |
#include<stdio.h> #include<conio.h> struct Book { char bname[20]; int pages; char author[20]; float price; }b1[3]; void main() { struct Book b1[3]={ {"BOOK1",700,"ypk",12.98}, {"BOOK2",500,"aak",350.00}, {"BOOk3",120,"HST",450} }; for(int i=0;i>3;i++) printf("%d\n",b1[i]); getch(); } iwant output book1 700 ypk 12.98 book2 500 aak 350.00 book3 120 hst 450. | |
I am making a program that does synthetic division, except for it is not showing the quotient only the remainder. I have checked my for loops so many times, and I can't understant what is happening here is my code: import java.util.*; import java.lang.*; class synthetic { static Scanner userInput … | |
Hi all , I have a set-interval function inside a for loop and when inside the set-interval function if it meets a criteria give an alert and clear the interval. Below is my code but its not working can anyone tell what the mistake here. var timeCheck = 0; function … | |
Although there are many similar questions and answers here and i've tried my best to make it work but no luck. This is my code: $content = "Blah...blah...[image=1], blah...blah...blah...[image=2], blah...blah...blah...[image=1], no more..."; function get_image($content) { $stripper = $content; preg_match_all("/\[image=(.+?)\]/smi",$stripper, $search); $total = count($search[0]); for($i=0; $i < $total; $i++) { $image_id … | |
i have some code i am working on andit keeps throwing an expression expected error. this code is designed to cheeck a RichTextBox form and highlight text, specified by a dictionary. Dim location As UInteger = 0 Dim dict As Dictionary(Of String, ULong) = getWords(rText1) Dim wcount As Integer = … | |
Hi Everyone. It's been a while since I was on here last, but ran into an interesting problem with a nested for loop that I cannot solve. Hoping someone here will know the answer. I placed breakpoints in my code at the For x=1 to 10 line and after to … | |
i have to do a pyramid with a pattern like this [iCODE] 1 1 2 1 1 2 4 2 1 1 2 4 16 4 2 1[/iCODE] i just realized dani web didnt take my center pyrmaid thing it moved to the side no matter what spacing i did … | |
| I have a C++ application that I want to make more flexible and user-friendly. It currently contains seven nested for-loops, and part of the new flexibility is that this number will become variable (between two and twenty, say). What is the easiest way to achieve this? |
I wrote this code for an assignment that asked to create a program that calculates and displays the average of any amount of real numbers. The program is supposed to ask the user how many numbers they want to enter and then use a loop to ask the user to … | |
Hi hope someone can can help im having a problem with how ripple is dealing with for loops when emulating an android app using html5 css jquery and jqtouch simple loop [CODE] var len = 1; for (i = 0; i <len; i++){ alert('foo'); } [/CODE] run it through chrome … | |
Hi! I'm making a chess program, that need to move pieces on the chess board, get an input,check if the move is valid and print the output. The compiler finds some errors that i don't understand...I need some help with the pieces functions. Plz help me fix them!!! my attempts … | |
Hi guys, Working on a table. Each of the entries has an A or B in the 'tip' field. I order them by 'tip' how can i add a special row for the first entry of the A or B series from the query? I know it's not an IF … | |
Okay so this is another question printing patterns but this time using input! I have to prompt the user and read an odd number from the input. I can only use System.out.print('*'); System.out.print(' '); and System.out.println(); I need to maximize my use of repetition and minimize the number of output … |
The End.