I am trying to display scores by what the user is requesting either 'Average','Total',or 'Both'. The following is my code for the loop_tester.php and below that is the code for my index.php. I am trying to add a switch statement to the index.php file that will sets values for only the average calculation if the user selected the "average" radio button, only the total calculation if the user selected the "total" radio button, both the average and total if the user selected the "both" button. After the user puts in the scores and then selects either 'average','total','both' it should display …

Member Avatar
Member Avatar
+0 forum 3

I am trying to sort averages of scores in a class by pupil, from highest to lowest. My data is stored in text files like this: Charlie:0 Seema:2 Amber:4 Paige:5 Amber:8 Keith:1 Charlie:8 Seema:0 Charlie:9 Seema:3 Paige:0 Paige:4 Paige:4 Charlie:1 Keith:5 Keith:3 Here is my code so far: with open("class {0}.txt".format(Class)) as f: d = {} #loop to split the data in the text file for line in f: column = line.split(":") #identifies the key and value with either 0 or 1 names = column[0][Click Here](null) scores = int(column[1].strip()) #appends values if a key already exists tries = 0 while …

Member Avatar
Member Avatar
+0 forum 5

Create a form that accepts scores from the user, displays the total, count, and average of the scores, and displays a dialog box that lists the scores.This application should check the number entered by the user to make sure it is a valid integer from 0 to 100. If a value is entered outside this range, the score does not count (and should not be included in the score total, score count, or average). Here's What I have: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Text.RegularExpressions; namespace Scores { public …

Member Avatar
Member Avatar
+0 forum 6

Hi Guys, I'm Using Python 2.7.3 This is my txt file: TimeStamp,Irradiance 21/7/2014 0:00,0.66 21/7/2014 0:00,0.71 21/7/2014 0:00,0.65 21/7/2014 0:00,0.67 21/7/2014 0:01,0.58 21/7/2014 0:01,0.54 21/7/2014 0:01,0.63 21/7/2014 0:01,0.65 21/7/2014 0:02,0.64 21/7/2014 0:02,0.63 21/7/2014 0:02,0.63 21/7/2014 0:02,0.64 . . . . 22/7/2014 23:57,0.53 22/7/2014 23:58,0.69 22/7/2014 23:58,0.61 22/7/2014 23:58,0.65 22/7/2014 23:58,0.59 22/7/2014 23:59,0.63 22/7/2014 23:59,0.67 22/7/2014 23:59,0.68 22/7/2014 23:59,0.58 How can i find the average/mode/max value of my txt file data and display it My program is using the data above and letting user to choose from time & to time then plot the user selected criteria (which i had done) …

Member Avatar
Member Avatar
+0 forum 5

plz tell me

Member Avatar
Member Avatar
+0 forum 1

I'm really struggling with this assignment. Here's what I have to do: Write a program that uses an array to store 10 elements, representing 10 students' test scores that will be entered from the keyboard. Given the following grading scale (given in my if statements) determine the letter grade each score will receive, and store the grade in a corresponding character array. Display the numeric score and the corresponding letter grade. Also calculate and display the class averagee as well as the number of students that receive each letter grade. Everything must be done in main. #include <iostream> using std::cout; …

Member Avatar
Member Avatar
+0 forum 1

My requirements are as follows: 1. use main method 2. use the following array- `int[] grades = new int[] {` `82, 70, 99, 90, 92, 75, 87, 85, 91, 100, 91, 87 ` `};` 3. Write code to step through the array of grades and calculate the average grade. Modify your code so that while it is stepping through the grades, it also looks for the minimum grade. Modify your code so that while it is stepping through the grades, it also looks for the maximum grade. **You should only have one loop and work on finding the average, min, …

Member Avatar
Member Avatar
+0 forum 12

C++ program to find sum of marks entered by 30 students using for loop or while loop/

Member Avatar
Member Avatar
+0 forum 2

//write a program whih takes input until user enters a negative number. print the sum of given inputs. #include <iostream> using namespace std; int main () { int a[10]; cout << " enter numbers " << endl ; int i = 0 ; while ( i < 10) {while (a[i] > 0 ) {cin>>a[i];} i++;} int sum = 0; i = 0 ; while ( i < 10 ) {sum=sum+a[i]; i++;} cout<< " sum is " <<sum; system ("pause"); return 0 ; }

Member Avatar
Member Avatar
+0 forum 2

Im suppose to write a program that accepts five input values and stores them into an array. The program should then display the average of the five numbers. Finally, the program should display all the numbers in the array that are larger than the average of the five numbers. I understand everything except how to display all the numbers in the array that are larger than the average of the five numbers. I cannot seem to figure this part out. Any help would be thankful.

Member Avatar
Member Avatar
+0 forum 4

i am getting result of average in int instead of float, tell me where i have made mistake. this is the code. #include<iostream> using namespace std; void getData (int a[], int s); int numbersSum (int a[], int s); float average (int sum, int size); int main() { int size=0; int a[size]; cout<<"how many numbers: "<<endl; cin>>size; cout<<"Enter "<<size<<" numbers:"<<endl; getData (a, size); int sum=0; sum=numbersSum (a, size); cout<<"sum of these "<<size<<" numbers is "<<sum<<endl; float avg=0; avg=average (sum, size); cout<<"the average of these "<<size<<" numbers is "<<avg<<endl; return 0; } void getData(int a[], int s) { for (int i=0;i<s;i++) { …

Member Avatar
Member Avatar
+0 forum 3

I am trying to build a code that outputs user input a certain way. I need to take user input to store 10 statistics for 3 players over 2 games, and then have the code ask the user which player they would like to see. Instead of showing the stats for the two games though, I need to just display the average. I'm having trouble understanding the concept of how to take the numbers that I've inputted and pull them out to an average. In my code below I have it set to display what I entered for game 1, …

Member Avatar
Member Avatar
+0 forum 5

I am (student) just switched to linux working on NoC (noxim) simulator in ubuntu 12.04 c++ is supported assignment from university, I want to make a script that call my whole program multiple times (for loop= e.g 10) and want to take average value from the functions that were called from other files. Should I create a new file for script? if yes then which header files should I call in that. and how to create log file of the above mentioned output, if simulation takes hours. I want for each iteration the value is saved and in the end …

Member Avatar
Member Avatar
+0 forum 1

I am working on NoC simulator in ubuntu 12.04 c++ is supported, I want to make a script that call my whole program multiple times (for loop= e.g 10) and want to take average value from the functions that were called from other files. Should I create a new file for scrip? if yes then which header files should I call in that. and how to create log file of the above mentioned output, if simulation takes hours. I want for each iteration the value is saved and in the end whole output is declared as an array. Need Help …

Member Avatar
Member Avatar
+0 forum 1

Hello, for some reason, I am getting a very weird negative nuber as my average for my program, here is my code: int sum, avg; sum = 0; avg = 0; for(int i = 1; i < size; i++){ sum += array[i]; } avg = sum / size; my output is :-6.84941e+061

Member Avatar
Member Avatar
+0 forum 3

Hello all. I wrote a program that gives me 100 random values from the range between -100 to +100. How am I supposed to find the minimum, maximum, and average of the values that will be listed when I run the program? I appreciate the help anyone can give me. Also, this is for a class and we are not allowed to use Arrays. Thanks again. Here is what I have so far: float random_integer; float lowest=-100.00, highest=100.00; float range=(highest-lowest)+1; for(float index=0; index<100; index++) { random_integer = lowest+float(range*rand()/(RAND_MAX + 1.0)); cout << random_integer << endl; } float sum; float average; …

Member Avatar
Member Avatar
+0 forum 7

Hi double[] MyArray = new double[10]; I have 10 numbers and I get average of them. But how can print out how many of the numbers that are smaller than average, and how many of the numbers that are larger than average?

Member Avatar
Member Avatar
+0 forum 9

Hi, I have 2 datagridview. 1 to show TANTOU, TOTAL SUM of DURATION and COUNT of event happened. Another 1 is to show TANTOU, AVERAGE of DURATION and COUNT of event happened. I have use LINQ function to get the result. But how can i combine it so that i can show both result in the same datagrid? (means, I just use 1 LINQ function that can display TANTOU, SUM, AVERAGE, and COUNT) here is the code of sum: Dim group As IEnumerable(Of DataRow) = _ From row In Ds.Tables(0).AsEnumerable() _ Group row By TANTOU = row.Field(Of String)("TANTOU") Into grp …

Member Avatar
+0 forum 0

Hello, I need help with code of sum and average, with a -100 to exit.

Member Avatar
Member Avatar
-1 forum 3

Combining queue and stack link list? hello so here is my question i ave to connect a link lists together, one who behaves like a stack the other like a queue.the numbers used are 11 22 44 77 33 99 66. so the stack link list looks like this 66 99 33 77 44 22 11 queue link list looks like this 11 22 44 77 33 99 66 what i need to do is combine both, connect the stack to the queue to make a new link list with 14 numbers. new link list should look like this 66 …

Member Avatar
Member Avatar
+0 forum 1

So I am trying to write a program that will tell you the lowest grade and the highest grade out of the 3 wthat you put in and also tell you the current average you have in the class. I got the lowest and highest part taken care of but I am having issues with it coming up with the current average you have in the class. It keeps giving me 0 as the average for the student and I can't find the mistake so I was hoping another set of eyes can help me out with this. Here is …

Member Avatar
Member Avatar
+0 forum 7

Hello again. I am trying to create a simple code that can compute the average of a set of numbers read in using a scanner. import java.util.Scanner; public class Average { public static void main(String[] args) { double number = 0; double total = 0; int count = 0; Scanner scan = new Scanner(System.in); while (number != -1) { System.out.println("Please enter a non negative number."); number = scan.nextDouble(); total = number++; System.out.println("The total is " + total); count++; } double average = total/count; System.out.println("The average is " + average); } } The loop occurs but it won't end. I wanted …

Member Avatar
Member Avatar
+0 forum 5

hi for my programming class we have to write an average calculator program in any langauge we want. I did mine in Java and im fairly new to programming. the problem with my code is how can I improve it to make sure user's incorrect input ruins program. for example if a user types in letters instead of numbers. here is my code. `import java.util.Scanner; import java.text.DecimalFormat; public class Average { public static void main(String[]args) { int count = 0; int total = 0; final int stopValue = 0; int number; Scanner scan = new Scanner(System.in); System.out.println("You can enter numbers …

Member Avatar
Member Avatar
+0 forum 5

Hi, I've got a problem to average lines which have same name. For exemple: > Strawberries 10 15 14 20 Pineapples 14 17 2 18 Apples 4 12 24 18 Strawberries 20 12 13 24 I would like to average values by fruit name. So, for pineapples, that easy, it's the average of the line. For strawberries, the average must be on the first and the last lines in this exemple. I think about array, hash and referencing but that doesn't work. Something like create a hash with fruit name in key and a link towards an array containing values, …

Member Avatar
Member Avatar
+0 forum 7

I'm having a problem getting the number of integers greater than the average in my array to display. I keep getting "You have 1 number greater than the average when there are 5 that are greater. Pls help!!! This is the code I've devolped so far: #include <iostream> using namespace std; int main(){ const int SIZE = 10; int myArr[SIZE]; double myAvg; int myCount = 0; cout<<"Give me 10 whole numbers: "<<endl; for(int i = 0; i<SIZE; i++){ cin>>myArr[i]; } myAvg = (myArr[0] + myArr[1] + myArr[2] + myArr[3] + myArr[4] + myArr[5] + myArr[6] + myArr[7] + myArr[8] + …

Member Avatar
Member Avatar
+0 forum 3

Hello all, I am having some trouble with my assembly code...still kind of new, but here it goes... The assignment is to desing an assembly program that uses a dialog box to prompt the user for a number. These numbers will be stored in an array. There will be an output message that shows the following: sum of numbers entered, how many numbers were entered(not counting the -9999 to end the program), the aerage of the numbers, and the count of array entries that are greater that or equal to the average value. All help is appreciated! Here is my …

Member Avatar
Member Avatar
+0 forum 2

So ive been trying to get an average of this array needed, and I seem to be having trouble with it. So far, my current code just adds the numbers up, but doesnt really average them out at all: [CODE]import java.util.Scanner; import java.util.Arrays; public class Grades { public static void main (String[] args) { double result = 0; Scanner scan = new Scanner(System.in); float[] grades = new float[100]; for (int i = 0; i < grades.length; i++) { System.out.print("Enter a grade between 0.0 - 100.0 (enter -1 to quit): "); grades[i] = scan.nextFloat(); if(grades[i] == -1)break; result = result + …

Member Avatar
Member Avatar
+0 forum 8

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 enter a number, keeping track of the sum as they are entered, and then calculating the average. I have it somewhat ok, until the end where it's supposed to give the average. I tried a couple things but none of them gave me the right answer. I don't think I'm …

Member Avatar
Member Avatar
+0 forum 8

This program determines the grade average, raised grade average, of individual students and all students. The program takes scanner input. In the scanner, the number of students, the number of grades for each student, and the grades of each student are entered. Ultimately, I need to print out each student's grade average, grade average when the lowest grade is dropped, total grade average of the "class," and raised grade average of the class. I have been spending an inordinate amount of time on this. Currently, my questions are: [COLOR="red"] How do I use nested for loops to take all the …

Member Avatar
Member Avatar
+0 forum 3

hi i am new here and i registered because i couldn't find the answer in google search my problem is that i could not find max and min of two arrays and the average too [CODE]#include<iostream> using namespace std; int array1[]={0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; int array2[]={0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; int a; int print_menu() { int choice; cout<<"#----------------------------------\n"; cout<<"# Manipulation of arrays #\n"; cout<<"# #\n"; cout<<"# BY MAFD #\n"; cout<<"#----------------------------------\n"; cout<<"# 1. Read Array 1 #\n# 2. Read Array 2 #\n"; cout<<"# 3. Max_min_two_arrays #\n# 4. sum_two_arrays #\n"; cout<<"# …

Member Avatar
Member Avatar
+0 forum 3

The End.