C/C++ :: Array To Only Print Out Final Average And Final Maximum Score With Final Minimum Score
Aug 27, 2014
#include <stdio.h>
float total, avg, max, min;
float judge[4];
int index;
int array[4];
int main() {
total = 0.0;
max = array[0];
min = array[0];
[Code] ....
I dont understand how to make the array when it prints out only print out the final average and the final maximum score with the final minimum score but what its doing at the moment is just giving an average for each individual score taken...
Minimum and maximum scores are displaying 0.0
And it displays these things 4 times in a row i just want it to be displayed once.
I have a program that is reading six characters from a text file, swapping every other character(ABCD would read BADC), and then adjusting their value based on a user's adjusted value input. If the adjusted value is 5 then letter A becomes F.
The final output line should print the initial six characters followed by the final six characters after the swap and encrypt adjustment.
I can only manage to print the final characters. Am I far off thinking I need to use pointers to point to the original character values?
One more thing: instructor wants us to complete this project as simply as possible meaning without the use of arrays, loops, switch statements, etc.
#include <iostream> #include <string> #include <fstream> using namespace std; int main() { //declarations char c1,
An instructor needs you to write a program that will compute the final average grades in her class. There are 5 students in the class. Each student must take 2 exams and 4 quizzes as part of their final grade. The weight of each toward the final grade is as follows:
You must use arrays to store each students 3 digit ID number, exam scores and quiz scores. A multi-dimensional array is mandatory. Request from the user the information needed then output all of the information as well as the final average grade for each student.
I have to create a program that calculates the final scores per diver, who each get five dives. I have to include the difficulty level when figuring out this score, and I need to drop the highest and lowest scores.
Now, I'm reading from a file where the values are something like:
Would I create a parallel array for the difficulty, or include it in a 2D array with the scores. Something like
score[Difficulty][individualScores]; ?
Also, would I include a findMin and findMax in a function that calculates the total, seeing as how the highest and lowest must be dropped to determine the final score?
Well, sort of - my question is, since the destructor has to be virtual in order to be marked final (you get an error otherwise), does this cause virtual function overhead anywhere, or add a vtable?
finding the last line of the code? I have a program with two functions that open and display a joke.txt and punchline.txt file. My joke function (which reads the entire file) works fine. The punchline function, however, does not.
I had to write a simple program that prompted the user for various test scores and it would pump out his grade average at the end. I did that with no issue, however, my instructor wants me to add something to the end off the code and I'm not sure how to do that. My code is:
#include <iostream> #include <iomanip> using namespace std; int main() { string tempType; float SumTest, MaxTest, TestAve,ProgAve,output; [Code] ....
And this is what I'm supposed to add, the averages are supposed to have numbers from what the user gave. *************************** Grade Calculator
I develop a software using QT 5 open source IDE. Now my question is two-fold:
1. How can I create the final executable file that I can upload for my users? I understand that runtime DLLs shall be required and I have tried Enigma Virtual Box software for bundling runtime files. It does create the file that I can execute from any folder in my PC. However, surprisingly when I transfer that "boxed" file to another PC, it does not run. Both the PCs have Windows 7 installed on them.
2. Secondly, I see possible future issues with Antivirus Softwares. Apparently when I try to run the boxed exe file, it gets rejected by the Antivirus Software on my PC. Is there a way in which I can get my exe file verified/checked/registered by the Antivirus Softwares so that my users don't face any problems in executing the program.
I cannot afford the QT commercial licence, but I am prepared to buy any economical "setup file generating" software (if it exists).
Write a C program that calculates the final value of an investment made in a TSX Market Linked GIC.
Specification
The return on this type of GIC (Guaranteed Investment Certificate) is based on the initial investment, the number of years (1, 2 or 3), a minimum return rate, a maximum return rate, a participation rate, the values of the TSX (Toronto Stock Exchange) index at specified intervals during the years, and the type of averaging of these values. The final investment value can only be calculated once all the TSX values are known.
If averaging is not used the TSX rate is determined from the opening and closing values only. If averaging is used the TSX rate is determined by calculating the TSX average at 6 monthly intervals, then is based on this average relative to the opening value. The TSX rate is then multiplied by the participation rate. If this new rate is below the minimum rate, then the minimum rate is used, and if it is above the maximum rate, then the maximum rate is used. Rates are printed to 2 decimal places, and the final investment is rounded down, and formatted using commas.
Only round down for the final investment. If the TSX rate is negative do not print the line for rate adjusted for participation. Assume that the final investment is less than one million dollars. (Hint: if you need to print leading zeros in a number, use the %0m.n format: example - the format specifier %06.2f prints 4.56 as 004.56)
Example 1: See below; averaging is not used, so TSX rate = (107-100)/100 = 7%. After using a participation rate of 80%, get 5.6% (which is between min & max rates).
Example 2: See below; averaging is used over 5 values to get a rate of 68% which equals 54.4% due to participation. This is more than the max rate, so the max rate is used.
The GIC calculator must use the following layout exactly.
+------------------------------------+ | TSX MARKET LINKED GIC CALCULATOR | +------------------------------------+ Enter initial investment : 1000.00 Enter number of years [1,2,3] : 3 Enter minimum and maximum rates [%] : 1 20 Enter participation rate [%] : 80 Enter if averaging used [1=yes,0=no]: 0 Enter open and close values : 100 107
+------------------------------------+ | TSX MARKET LINKED GIC CALCULATOR | +------------------------------------+ Enter initial investment : 2000.00 Enter number of years [1,2,3] : 2 Enter minimum and maximum rates [%] : 1 20 Enter participation rate [%] : 80 Enter if averaging used [1=yes,0=no]: 1 Enter 5 TSX values : 200 190 320 430 540
Final investment . . . . . . . . . . $ 2,040.00 i wrote something like
Code: #include <stdio.h> int main (void) { int years, minimum, maximum, partrate, x, open, close, tsxvalue; float investment, tsxrate, y, finalinvestment, maxrate, minrate; printf("+------------------------------------+
[Code] ....
I don't know what the exact calculation should be here now to get the rest....so I'm stuck here
I want this programming to call functions choose between a customer type and call the relevent function to calculate the final price but it is not calling the functions.
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 am studying about recursion by myself and i want to make a recursive function that prompts the user to input the base and exponent and generate the final answer .
#include<iostream> using namespace std; int recursive(int x, int y); int main() { /*int total=1; int y, x;
How to traverse through this array and output each student and score that falls below the average. I think I may have the method down for traversing through the list to find the "total score" however, before proceeding under a possible wrong presumption, I would like confirmation as to whether or not I'm understanding this or botching this concept.
void dispLowScore(struct payload *arrayStart , //first element of array struct payload *arrayEnd ) //last element of array { int studentCount; //total number of students in list/array int totalScore ; //accumulated value of all scores added together float averageScore; //totalScore / studentCount
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.
Using the array to accept 10 testscore. Calculate and print the highest, lowest, fifth test score entered and all the test score entered in reverse order.
How i would get it to print the highest,and lowest and in reverse order. I'm confused as to what to do...
5. Find the deviation of each score, and display the score and its deviation.
6. Find the Standard Deviation and Display
7. How many scores are within One Standard Deviation
So I have the average down, but I am getting stuck at the part of displaying the highest and lowest score. Every time I run the program I get two giant negative numbers for both of them. I put all the scores into a .txt file and I just opened in through the program.
I have two numbers and a number that is final number. Which number is approximate the final number ?
For example:
Our final number is : -1/2 and the two numbers is 4 and 3. How can I compare it ? Or i have numbers more than two like 5 number or 7 number or so foth numbers and final number is : -1/2