Help me please!!

0 Xhengis Miftari · April 1, 2015
please help me with this program
Write a C++ program for a college’s admissions office. Prompt the user for a student’s numeric high school grade point average (for example, 3.2) and an admission test score from 0 to 100. Print the message “Accept” if the student has any of the following: A grade point average of 3.0 or above and an admission test score of at least 60 A grade point average below 3.0 and an admission test score of at least 80 If the student does not meet either of the qualification criteria, print “Reject”.

Post a Reply

Replies

- page 1
Oldest  Newest  Rating
+1 zhang yida · May 3, 2015
it's very easy ,why dont you try to figure it out with Google by yourself,I think you will learn it better.
0 Xhengis Miftari · April 6, 2015
hello!!
now i have done the most ecerxise but i have stuck at these point
the xercise-----Write an application that displays a menu of three items in a restaurant as follows:
1. Cheeseburger 4.99
2. Pepsi 2.00
3. Chips 0.75
Prompt the user to choose an item using the number (1, 2, or 3) that corresponds to the item, or to enter 0 to quit the application. After the user makes the first selection, if the choice is 0, display a bill of $0. Otherwise, display the menu again. The user should respond to this prompt with another item number to order or 0 to quit. If the user types 0, display the cost of the single requested item. If the user types 1, 2, or 3, add the cost of the second item to the first, and then display the menu a third time. If the user types 0 to quit, display the total cost of the two items; otherwise, display the total for all three

My code
#include<iostream>
using namespace std;
int main ()
{
int product, item1, item2, item3;
cout<<"Chose a product: "<<endl;
cout<<"1 for cheseburger"<<endl;
cout<<"2 for pepsi"<<endl;
cout<<"3 for chips"<<endl;
cout<<"0 to quit"<<endl;
cin>>product;
switch(product)
{

case 0:




case 1:
cout<<"The price is 4.99"<<endl;
cout<<"Chose a product: "<<endl;
cout<<"1 for cheseburger"<<endl;
cout<<"2 for pepsi"<<endl;
cout<<"3 for chips"<<endl;
cout<<"0 to quit"<<endl;
break;


case 2:
cout<<"The price is 2.00"<<endl;
cout<<"1 for cheseburger"<<endl;
cout<<"Chose a product: "<<endl;
cout<<"2 for pepsi"<<endl;
cout<<"3 for chips"<<endl;
cout<<"0 to quit"<<endl;
break;


case 3:
cout<<"The price is 0.75"<<endl;
cout<<"Chose a product: "<<endl;
cout<<"1 for cheseburger"<<endl;
cout<<"2 for pepsi"<<endl;
cout<<"3 for chips"<<endl;
cout<<"0 to quit"<<endl;
break;



}


}
0 Xhengis Miftari · April 1, 2015
please help me with this program

Write a C++ program for a college?s admissions office. Prompt the user for a student?s numeric high school grade point average (for example, 3.2) and an admission test score from 0 to 100. Print the message ?Accept? if the student has any of the following: A grade point average of 3.0 or above and an admission test score of at least 60 A grade point average below 3.0 and an admission test score of at least 80 If the student does not meet either of the qualification criteria, print ?Reject?.
0 zahidul haque · April 2, 2015
you means that someone should write the complete code for you. Buddy that's not good. Burn your finger and come up with your code. Then ask the question what problem you are facing. Believe me it's going to help you out.

Dono br afraid. You will enjoy. Till then happy coding.
0 Xhengis Miftari · April 2, 2015
the problem is that i am facing the problem since the begining 
0 Dimitrios Pechlivanis · April 2, 2015
Then you can start watching the C++ tutorials , they are pretty detailed and will totally cover your needs for this program.
0 Dol Lod · April 2, 2015
Just built up your code incrementally. Figure out how to read input from stdin and how to print to stdout. 
0 Xhengis Miftari · May 2, 2015
thank you man for your help even though i managed to do it by my self and now after many days when i saw you i was heppay that someone tried to help me
0 Xhengis Miftari · May 2, 2015
i have this exercise i have done most of it but i dont know to continue.could anyone help me?
Write a C++ program using functions to calculate the area and perimeter of a rectangle.
The program should meet the following requirements: [14 points]
a. Accept input from the user for length and width, both of which are of type double.
b. Create a value-returning function named calculateArea that takes two parameters,
namely the length and the width of the rectangle, which are of type double. This
function should return a double value. Formula: Area=Length x Width
c. Create a value-returning function named calculatePerimeter that takes two
parameters, namely the length and the width of the rectangle, which are of type
double. This function should return a double value. Perimeter=2 x (Length + Width)
d. Create a void function named display that displays the area and the perimeter of the

my code:
#include<iostream>
using namespace std;

double calculateArea(double length, double width,double Area)
{
cin>>length>>width;
Area=length*width;
return Area;
}
double calculatePerimeter(double length, double width,double Perimeter)
{
cin>>length>>width;
Perimeter=2*(length+width);
return Perimeter;
}


int main()
    {

double calculateArea(double length, double width, double Area);
    double calculatePerimeter(double length, double width, double Perimeter);
cout<<"Enter length and width : "<<endl;
return 0;
  }
0 Franz Schmidt · May 2, 2015
You have really nice starting points with your function.

But you have some little mistakes. If you return a value from a function you don't need to pass a parameter to the function for this variable. You need to declair the Area and the Perimeter variable inside your function and not as a parameter of the function. 

And when you call a function inside the main you don't need to write the return type before the function name and for the parameter variables you need to pass on real values and not undefined variables.
And if you have a return type of a function you need to asign the return value to a variable:
double Area = calculateArea(3, 4);

Don't worry, skill comes with practice, those are only some beginners mistakes.


I made your program like this: http://txt.do/xbe0

I don't know how far you learnd C++ but if you really want to do real C++ you should learn how to code in an object oriented way with classes and stuff.
Here is the whole code in OOP: http://txt.do/xbet
  • 1
  • 2

C++

107,232 followers
About

Used in many types of software including music players, video games, and many large scale applications.

Links
Moderators
Bucky Roberts Administrator