i have a problem on my program, actually it runs and compile but it is lacking of the informaton needed, can you please help me with this, im really appreciate in any comments, Here it is
The grade should follow the table below
<50 fail
50-59 D
60-69 C
70-79 B
80-89 A
90-100 exellent
enter no: 50
do you want to enter another? yes
enter no: 50
do you want to enter another? yes
enter no: 100
do you want to enter another? no// with this statement the program will stop and he needs to diplay this:
your total input : 3
the percentage Failed is: 0%
the percentage D is: 66.67%
the percentage C is: 0%
the percentage B is: 0%
the percentage A is: 0%
the percentage Exellent is: 33.33%
how can i make the total of that three inputs into code,
and how can i get the code of that percentage of A,B,C,D,Excellent and failed
this is what I’ve got so far - #inlude <iostream.h>
-
#include<string.h>
-
#include <conio.h>
-
#include <stdio.h>
-
-
class Grade
-
-
{
-
-
Grade () {};
-
~Grade () {};
-
void Message();
-
int Gradefailed ( int F, int Total);
-
int GradeD ( int D, int Total);
-
int GradeC ( int C, int Total);
-
int GradeB ( int B, int Total);
-
int GradeA ( int C, int Total);
-
int GradeDistinction ( int Distinction, int Total);
-
};
-
-
void Message();
-
{
-
cout <<"enter grade:\n";
-
cin<< score;
-
cout <<"Do you want to enter another:";
-
cin >> answer;
-
}
-
int Gradefailed ( int F, int Total);
-
{
-
return (F/Total)*100;
-
}
-
int GradeD ( int D, int Total);
-
{
-
return (D/Total)*100;
-
}
-
int GradeC ( int C, int Total);
-
int GradeB ( int B, int Total);
-
int GradeA ( int C, int Total);
-
int GradeDistinction ( int Distinction, int Total);
-
-
same as the other foramat as above
-
-
}
-
-
int main ()
-
-
{
-
-
clrscr();
-
Grade *p = new Grade;
-
int score;
-
char answer[5]="yes"
-
-
while (stricmp (answer, "no")!=0)
-
-
{
-
p->Message ();
-
-
{
-
-
while mark (==0)
-
{
-
cout << "\n\nAnswer can’t be zero\n";
-
}
-
cout << "\nDo you want to solve another equation ? ( Yes ) or ( No )" << endl;
-
cin >> answer;
-
cout <<”please enter grade:”;
-
cin >> grade;
-
while(( stircmp( answer, "yes" ) != 0 ) && ( stricmp( answer, "no" ) != 0 ))
-
{
-
cout << "Please only answer by \"yes\" or \"no\"!";
-
cin >> answer;
-
}
-
getch ();
-
}
-
delete p;
-
}
-
how can make this kind of aoutput
your total input(s) is/are : 3
the percentage Failed is: 0%
the percentage D is: 66.67%
the percentage C is: 0%
the percentage B is: 0%
the percentage A is: 0%
the percentage Exellent is: 33.33%
thanks in advance!!!!!!!!!
3 2086
i have a problem on my program, actually it runs and compile but it is lacking of the informaton needed, can you please help me with this, im really appreciate in any comments, Here it is
The grade should follow the table below
<50 fail
50-59 D
60-69 C
70-79 B
80-89 A
90-100 exellent
enter no: 50
do you want to enter another? yes
enter no: 50
do you want to enter another? yes
enter no: 100
do you want to enter another? no// with this statement the program will stop and he needs to diplay this:
your total input : 3
the percentage Failed is: 0%
the percentage D is: 66.67%
the percentage C is: 0%
the percentage B is: 0%
the percentage A is: 0%
the percentage Exellent is: 33.33%
how can i make the total of that three inputs into code,
and how can i get the code of that percentage of A,B,C,D,Excellent and failed
this is what I’ve got so far
#inlude <iostream.h>
#include<string.h>
#include <conio.h>
#include <stdio.h>
class Grade
{
Grade () {};
~Grade () {};
void Message();
int Gradefailed ( int F, int Total);
int GradeD ( int D, int Total);
int GradeC ( int C, int Total);
int GradeB ( int B, int Total);
int GradeA ( int C, int Total);
int GradeDistinction ( int Distinction, int Total);
};
void Message();
{
cout <<"enter grade:\n";
cin<< score;
cout <<"Do you want to enter another:";
cin >> answer;
}
int Gradefailed ( int F, int Total);
{
return (F/Total)*100;
}
int GradeD ( int D, int Total);
{
return (D/Total)*100;
}
int GradeC ( int C, int Total);
int GradeB ( int B, int Total);
int GradeA ( int C, int Total);
int GradeDistinction ( int Distinction, int Total);
same as the other foramat as above
}
int main ()
{
clrscr();
Grade *p = new Grade;
int score;
char answer[5]="yes"
while (stricmp (answer, "no")!=0)
{
p->Message ();
{
while mark (==0)
{
cout << "\n\nAnswer can’t be zero\n";
}
cout << "\nDo you want to solve another equation ? ( Yes ) or ( No )" << endl;
cin >> answer;
cout <<”please enter grade:”;
cin >> grade;
while(( stircmp( answer, "yes" ) != 0 ) && ( stricmp( answer, "no" ) != 0 ))
{
cout << "Please only answer by \"yes\" or \"no\"!";
cin >> answer;
}
getch ();
}
delete p;
}
how can make this kind of aoutput
your total input(s) is/are : 3
the percentage Failed is: 0%
the percentage D is: 66.67%
the percentage C is: 0%
the percentage B is: 0%
the percentage A is: 0%
the percentage Exellent is: 33.33%
thanks in advance!!!!!!!!!
Hi.... here i have the solution written in c.... Is it required one...? - #include<stdio.h>
-
-
int main()
-
{
-
int n[100],j,i=0;
-
float f=0,d=0,c=0,b=0,a=0,e=0;
-
char ch='Y';
-
while(ch!='N')
-
{
-
printf("Enter the number:\n");
-
scanf("%d",&n[i]);
-
i++;
-
printf("Do you want to enter another? Y/N\n");
-
scanf("%s",&ch);
-
}
-
-
printf("Your total input : %d\n",i);
-
-
for(j=0; j<i; j++)
-
{
-
if(n[j]<50)
-
f++;
-
else if(n[j]>=50 && n[j]<=59)
-
d++;
-
else if(n[j]>=60 && n[j]<=69)
-
c++;
-
else if(n[j]>=70 && n[j]<=79)
-
b++;
-
else if(n[j]>=80 && n[j]<=89)
-
a++;
-
else if(n[j]>=90 && n[j]<=100)
-
e++;
-
}
-
-
printf("the percentage Failed is: %f\n",(f*100)/i);
-
printf("the percentage D is: %f\n",(d*100)/i);
-
printf("the percentage C is: %f\n",(c*100)/i);
-
printf("the percentage B is: %f\n",(b*100)/i);
-
printf("the percentage A is: %f\n",(a*100)/i);
-
printf("the percentage Exellent is: %f\n",(e*100)/i);
-
return 0;
-
}
Hi.... here i have the solution written in c.... Is it required one...? - #include<stdio.h>
-
-
int main()
-
{
-
int n[100],j,i=0;
-
float f=0,d=0,c=0,b=0,a=0,e=0;
-
char ch='Y';
-
while(ch!='N')
-
{
-
printf("Enter the number:\n");
-
scanf("%d",&n[i]);
-
i++;
-
printf("Do you want to enter another? Y/N\n");
-
scanf("%s",&ch);
-
}
-
-
printf("Your total input : %d\n",i);
-
-
for(j=0; j<i; j++)
-
{
-
if(n[j]<50)
-
f++;
-
else if(n[j]>=50 && n[j]<=59)
-
d++;
-
else if(n[j]>=60 && n[j]<=69)
-
c++;
-
else if(n[j]>=70 && n[j]<=79)
-
b++;
-
else if(n[j]>=80 && n[j]<=89)
-
a++;
-
else if(n[j]>=90 && n[j]<=100)
-
e++;
-
}
-
-
printf("the percentage Failed is: %f\n",(f*100)/i);
-
printf("the percentage D is: %f\n",(d*100)/i);
-
printf("the percentage C is: %f\n",(c*100)/i);
-
printf("the percentage B is: %f\n",(b*100)/i);
-
printf("the percentage A is: %f\n",(a*100)/i);
-
printf("the percentage Exellent is: %f\n",(e*100)/i);
-
return 0;
-
}
hi there,
thanks alot, i really appreciate it, and I,m so glad that you'll helping me
do you know any solution in C++,
thanks,
mike
c code should work in c++ without too much tweaking....
Sign in to post your reply or Sign up for a free account.
Similar topics
by: C.E.O. Gargantua |
last post by:
http://blog.seattlepi.nwsource.com/microsoft/
Featured in the blog:
Grading Bill Gates
Charles Cooper, CNet News.com executive editor, assesses the performance of
Bill Gates as the company's...
|
by: rockwell |
last post by:
Hi groups i want to write a program ro numerically integrate an
equation using the rectangle method,i know a little bit about the
rectangle method but never used it abd dont quite really know how...
|
by: Albert |
last post by:
how do i write a program that outputs its input if its input is more
than 80 characters?
|
by: Akinyemi |
last post by:
I am writing a Visual Basic program for calculating students scores, and also grading the highest 3 scores as "First" , "Second" and "Third" respectively.
I have been able to get the program to...
|
by: hjc |
last post by:
i am trying to created a program that will write a grading program for a class with the following policies
there are 2 quizzes each graded on the basis of 10 points
there is 1 midterm and 1...
|
by: Brian Blais |
last post by:
Hello,
I have a couple of classes where I teach introductory programming using Python. What
I would love to have is for the students to go through a lot of very small programs,
to learn the...
|
by: cazconv2007 |
last post by:
hi i have homework due tomorrow been trying to do java homework all week and nothings happening
really starting to stress out i dont understand what the program is meant to do or how to use three...
|
by: Grimmjow04 |
last post by:
first of all, im a beginner with this thing.. turbo C,,
my prof gave us a homework:
we must do a grading system consist of:
format>>>
Grading System
Enter your name:
|
by: gator6688 |
last post by:
I have to write a program that allows the user to enter the information for up to 20 students. The info then has to be displayed and written to a file. After I enter the first students info and hit...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
| |