C++ :: Program To Calculate Total Grade For N Classroom Exercises As Percentage
Mar 5, 2013
Write a program that calculates the total grade for N classroom exercises as a percentage. The user to input the value for N followed by each of the N scores and totals. Calculate the overall percentage (sum of the total points earned divided by the total point possible) and output it as a percentage. Sample input and output it as a percentage. Sample input and output is shown below.
How many exercises to input?
score1: 10
total points possible: 10
score2: 7
total points possible: 12
score3: 5
total points possible: 8
Code:
# include <iostream>
using namespace std;
int main () {
double N=0, score, total, totalScore=0, totalGrade=0, GRADE;
cout<<"How many excersices will be scored?/n";
I am using codeblocks for school and I am trying to create a program to calculate a percentage for commission and a bonus. I have tried using a decimal for percentage, int and floats with casting. Every time it I try it displays 0 or just the bonus. I even took and did a test page. My head is about to pop.
Write an algorithm that can be used to calculate the commission earned in a real estate transaction. The chart below describes the formulas used to calculate the commission.
Sales Price Commission Less than $100,000 5% of Sales Price $100,000 to $300,000 $5,000 + 10% of Sales Price over $100,000 More than $300,000 $25,000 + 15% of Sales Price over $300,000
// Commission and Bonuses. #include <iostream> #include <iomanip>
I'm writing a program to calculate a final grade by adding 4 numbers minus the lowest grade and dividing by 3. My knowledge in c is not extensive I thought that a simple assigment operator would do the job but I'm getting a strange large numbers in the execution.
I am trying to code and compile a program that requests a uses to first inpu the number of sides they wish for a dice to have and secondly input the number of dice throws they would like to calculate the value for. The program will print an error message and default the number of sides the dice has to 5 if the number entered is below 4. Finally it will print out a percentage figure for each value that results from all the the dice rolls.
I have attached my header, driver and class files below along with accompanying error messages below them
// file name Exercise.cpp #include <iostream> #include "Die.h" using namespace std; int main() // the main program begins here { char restart = 'y'; // declare variables double numRolls = 0.0; int diceTot = 0;
So I have to write a program to calculate a grade letter into a number.
Letter grades are A, B, C, D, and F, possibly followed by + or –. Their numeric values are 4, 3, 2, 1, and 0. There is no F+ or F–. A + increases the numeric value by 0.3, a – decreases it by 0.3. If the letter grade is illegal (such as "Z"), then your output should be "INVALID LETTER GRADE"; If the combination is illegal (such as "A+" or "F-") then your output should be "INVALID GRADE COMBINATION"
Also the code should look like this Enter your letter grade: C+ Grade value is [2.3]
// Input cout << "Enter your letter grade: "; string s; cin >> s;
I get so close, and then it seems my brain shuts down ... I need to write a program that outputs a histogram of student grades for an assignment. The program should input each student's grade as an integer and store the grade in a vector. Grades should be entered until the user enters -1 for a grade. The program should then scan through the vector and compute the histogram. In computing the histogram, the minimum value for a grade is 0, but your program should determine the maximum value entered by the user. Use a dynamic array to store the histogram. Output the histogram to the console. For example, if the input is:
20 30 4 20 30 30 -1
Then the output should be:
Number of 4’s: 1 Number of 20’s: 2 Number of 30’s: 3
I can't quite get my output to look like that:
/* This program will display the histogram of student grades for an assignment */ #include <iostream> #include <vector> #include <stdlib.h> #include <conio.h>
I'm having trouble getting the program to calculate the percentage of times it flipped either heads versus tails. I realize what I currently have doesn't work because above I initialized heads and tails by giving them values of 0, but I'm unsure of how to fix it.
#include <iostream> #include <cstdlib> #include <ctime> using namespace std; int main () { srand(time(0));
I am trying to code a program that takes in user inputted data about percentages and using it to later on calculate a final grade. 4 percents are inputted, for Assignments, Midterm1, Midterm2, and Finals. If the percents dont add up to 1 (i tell the user to enter the decimal value) I set up and if statement to catch it and end the program. Except that if i type in
I have a program that needs to calculate the total for three stores payrolls.
Inputs would be the three stores payrolls Output would be the total of all three
I HAVE to use the while statement.
I have also read the articles on the while statement on here and on other sites. I'm having trouble because every site I've seen so far has only been giving examples of numbers(like counting down or repeating a statement so many times).
Code:
#include <iostream> #include <cmath> using namespace std; int main() { //declare variables int storePayroll = 0; int totalPayroll = 0; int storeNum = 0;
I have a window form with datagridview,textbox,button and listbox. In datagridview i have added a column. In first row i have given the value like 7000,
second row 2500, third row 7000, fourth row 1000, fifth 1300, sixth 9000....n number of row:
if i enter 12000 in textbox1 then it will calculate the total in particular rows in datagridview.And the total should be less than 12000 what we have entered the value in textbox1.
The result will display in listbox..
like first greater value is 9000+2500=11500 , second greater value 7000+1000+1300=9500, other third greater value is 7,000.
So i have given a sample code where i cannot get the solution ..
double search; search = double.Parse(textBox1.Text); double sum = 0; for (int i = 0; i < dataGridView1.Rows.Count - 1; i++) { double se2 = Convert.ToDouble(dataGridView1.Rows[i].Cells[0].Value.ToString()); if (se2 == search) {
I want to calculate the total some of delay pf receiving Side Packet . Code is as Follow ..
What is weird that even if i invoke a sleep of 2 sec ,than its show delay always zero. Delay will be in microsec ..Is there any problem with logic or anything else..
Code:
do {#pragma omp parallel private(nthreads, tid) { /* Obtain thread number */ tid = omp_get_thread_num(); if (tid == 0) { nthreads = omp_get_num_threads();
Write a program which is used to calculate GPA based on the grades from different courses Input by the user. User should be able to enter as many course unless they choose to quit. Once the user has completed entering the data, the program should be able to provide a feedback on the GPA. Where A=4, B=3, C=2, D=1.
I have to accept the numerical grade and determine the letter grade that the user will receive. I have to use a grading table to determine the letter grade based on the numerical grade. The Letter Grade table is
Write a C++ program to calculate the fewest number of each denomination needed to pay a bill of amount TOTAL. For example, if the end user enters $97 for TOTAL, program will output that the bills would consist of one $50 bill, two $20 bills, one $5 bill, and two $1 bills. (Assume that the amount is in whole dollars, no cents, and only $100, $50, $20, $10, $5, and $1 denominations are available.) Aid: You may want to use the modulus operator %.
I am trying to create a word counter program that asks for the price per letter and then asks for the sentence they are writing. The app should then calculate the number of letters and give the total cost similar to:
You have 40 letters at $3.45 per letter, and your total is $138.00.
Everything compiles fine but when I run it the inputs don't work and it outputs:
You have -1 per letter, and your total cost is $-0.
SYNOPSIS : KBJ tourist agency Sdn. Bhd wants you to write an application program to calculate the total price for their customers for a package of vacation. The following table shows the price for three destinations (transportation and accommodation) offered by the agency:
Destination TransportationAccommodation Pulau Redang Child RM15.00 Adult RM30.00RM95 per day Pulau Perhentian Child RM20.00 Adult RM30.00 RM100 per day Pulau Kapas Child RM10.00 Adult RM20.00 RM120 per day
This agency company will give some discount to a group of customers with is:
a.10% discount will be given for the group that has a least 5 adults.
b.25% discount will be given for the group that has more than 5 persons (adults and children)
c.30% discount will be given for the group that has at least 15 persons.
Your application program has to display the output using this following screen layout:
KBJ TOURIST CUSTOMER INFORMATION
Customer’s name: XXXXXXXXXXXXX Number of Children:XXXXX Number of Adult: XXXXX Transportation: RMXXX.XX Accommodation: RMXXX.XX Total price: RMXXXX.XX
This is the code i got so far but it doesn't work..:(
#include <iostream.h> int main () { char customerName,code,A,B,C; int childNum,adultNum; double rate,discount,totalPrice,a,c;
Im just wondering how would i get a formula to calculate the total size and proportion of how far the media player has been played, in proportion with the size of the sizeable form, i need an int for the:
Width of formLength of movieHow long has been played by user
I have this code so far:
//The current position played! - Within the timer.tick event arg! string splayed = axWindowsMediaPlayer1.Ctlcontrols.currentPosition.ToString().Split('.')[0]; int iplayed = Convert.ToInt32(splayed + 1); //The total time of the movie/audio. string stotal = axWindowsMediaPlayer1.Ctlcontrols.currentItem.duration.ToString().Split('.')[0]; int itotal = Convert.ToInt32(splayed);
[Code] ....
I have the "AxWindowsMediaPlayer" reference installed, but i need to know how it would work...
The point of this is to calculate the total of the monthly costs of these 6 expenses and then to show the annual cost. However, there's just a couple of things that's giving me problems and it's the calcMonCost in my code. The error says that it is more than one instance of overload function and also that an unresolved external symbol. Everything else is fine. What does this mean?