Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

along with the program please show the uml diagram as stated the mark scheme and

ID: 3882373 • Letter: A

Question


along with the program please show the uml diagram as stated the mark scheme and look closely on the mark scheme

4. Write a menu driven program to register students for a CIS competition. The program must be able to register at least 10 competitors. Registration details for competitors includes Student Identification Number, Name, Date of Birth, Gender, Address. An address must have the following attributes Street, City and Parish. After the students are registered for the competition the computer will randomly select three unique competitors for the national finals. Neatly Display the selected competitors details in one dialog box. Note: The school name cannot change, however the phone number and email address for the school can change but they are common for all competitors. ArrayList must not be used! [62 marks] Competitors minimumalowable age is 18. Print a All competitors sorted in ascending order by last name Print unique list of randomly selected finalist Mark Scheme Criteria Demonstrate use of static Demonstrate use of final Demonstrate use of this Association Encapsulation Comments Java naming convention User define method to calculate age precisely Overloading (Constructor and Method) Sort selected students in ascending order by last name. Hint (Use Comparator Comparable) Random selection of three unique finalist Properly documented Error free program UML Class diagram Marks Attained 2 2 4 4 10 13 12

Explanation / Answer

i have taken base ball competition

#include <iostream>

#include <iomanip>

using namespace std;

void showMenu();

void displayBill(float bill, float totalBill, float& tip, float& taxDue);

void displayChange(float amtTendered, float amtChangeDue);

float bill, totalBill, amtTendered, amtChangeDue, taxDue, tipDue;

int main()

{

//constants for menu items

const int hamburgerPrice = 6;

const float hotdogPrice = 4.5;

const float peanutsPrice = 3.75;

const float popcornPrice = 5.5;

const float sodaPrice = 2.8;

const int chipsPrice = 1;

const int waterPrice = 2;

//tax constant

const float tax = 0.054;

const float tip = 0.20;

//total variables

char menuChoice;

float bill = 0;

void showMenu();

{

cout << "Baseball Game Snack Menu" << endl;

cout << "1 - hamburger $6.00" << endl;

cout << "2 - Hotdog $4.50" << endl;

cout << "3- Peanuts $3.75" << endl;

cout << "4 - Popcorn $5.50" << endl;

cout << "5 - Soda $2.80" << endl;

cout << "6 - Chips $1.00" << endl;

cout << "7 - Water $2.00" << endl;

cout << "8 - END ORDER" << endl;

}

cout << "Enter menu item: ";

cin >> menuChoice;

do

{

switch (menuChoice)

{

case '1':

bill = bill + hamburgerPrice;

cout << "Enter menu item: ";

cin >> menuChoice;

break;

case '2':

bill = bill + hotdogPrice;

cout << "Enter menu item: ";

cin >> menuChoice;

break;

case '3':

bill = bill + peanutsPrice;

cout << "Enter menu item: ";

cin >> menuChoice;

break;

case '4':

bill = bill + popcornPrice;

cout << "Enter menu item: ";

cin >> menuChoice;

break;

case '5':

bill = bill + sodaPrice;

cout << "Enter menu item: ";

cin >> menuChoice;

break;

case '6':

bill = bill + chipsPrice;

cout << "Enter menu item: ";

cin >> menuChoice;

break;

case '7':

bill = bill + waterPrice;

cout << "Enter menu item: ";

cin >> menuChoice;

break;

case '8':

exit(0);

default:

cout << "You did not enter a menu item! (1-8):";

cin >> menuChoice;

break;

}

} while (menuChoice < 8);

void displayBill(float& bill, float totalBill, float& tip, float taxDue);

{

float taxDue = bill * tax;

float tipDue = bill * tip;

float totalBill = bill + taxDue + tipDue;

cout << setprecision(3) << "Bill = $" << bill << endl;

cout << "Tax = " << taxDue << endl;

cout << "Tip = " << tipDue << endl;

cout << setprecision(3) << "Total amount due: $" << totalBill << endl;

}

void displayChange(float& amtTendered, float amtChangeDue);

{

cout << "Enter Amount Tendered: " << endl;

cin >> amtTendered;

if (amtTendered < (bill + tip + tax))

{

cout << "Please enter enough to cover total bill" << endl;

cin >> amtTendered;

}

else

{

amtChangeDue = totalBill - amtTendered;

cout << "Change Due: $" << amtChangeDue << endl;

}

}

}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at drjack9650@gmail.com
Chat Now And Get Quote