Question: Create a C++ program that computes a student report card system. This C++ project on student report card should have student class with data members
Create a C++ program that computes a student report card system.
This C++ project on student report card should have student class with data members like roll no, name, marks and grade. Member functions in this class are used for accept / display details of students and a function to calculate grade based on marks obtained by student. Student Records are stored.
Please include the following things:
-if statement
-while loop
-user-defined function
-array (use a loop to process)
The code should be this type, (this is just an example and should not be followed)
#include
int main() { // Declare variables int choice; // user's selection from menu int numItems; // number items desired double total=0.0; // total before tax //double price1=3.0; // price of item 1 //double price2=2.0; // price of item 2 double price;
// Display menu of items printf("Welcome to MinerMeals ! "); printf("Please enter the number of your selection "); printf(" 1. One slice of pizza $3.00 "); printf(" 2. Sandwich $2.00 ");
// Prompt and read in user data scanf("%d", &choice);
printf("How many would you like?"); scanf("%d", &numItems);
// "Echo-print" what was read in printf("Your choice was: %d ",choice); printf("You ordered %d items ",numItems);
// Test user's menu choice and compute total cost if (choice == 1) { price = 3.0; //total = numItems * price1; total = numItems * price;
} else if (choice == 2) { price = 2.0; //total = numItems * price2; total = numItems * price; } else { printf("Invalid selection. Choice should be 1 or 2. "); }
printf("Your total cost is: $%.2f ",total);
return 0; } // end of main
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
