Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I have a computer science project in the C + + language and I have code, but I also want to complete it with these
I have a computer science project in the C language and I have code, but I also want to complete it with these requirements. I ask you, if there is an error in my code, correct it for me and send me the complete correct code so that I can run it I will send you the code now and I want you to complete it with these requirements.
this is the code
#include
#include
using namespace std;
struct accounts
string name;
int phoneNumber;
string nuberhode;
int payments;
;
void inputDataaccounts print int size;
void bubbleSortaccounts print int size;
void outputDataaccounts print int size;
int calculatePaymentSumaccounts print int size;
double calculateSalarySumstruct driver drivers, int num;
struct driver
string name;
double salary;
void fineDeduction
double fine salary;
salary fine;
;
int main
int size;
cout "Enter number of students: ;
cin size;
accounts asize;
inputDataa size;
bubbleSorta size;
outputDataa size;
int paymentSum calculatePaymentSuma size;
cout "Total payment sum: paymentSum endl;
int num;
cout "Please enter the number of drivers: ;
cin num;
driver dd new drivernum;
for int i ; i num; i
cout "Please enter the driver's name: ;
cin ddiname;
cout "Please enter the driver's salary: ;
cin ddisalary;
char vio;
cout Is there any violation against the driver? YN: ;
cin vio;
if vio Y vio y
cout "Enter the name of the driver who violated: ;
string violatorName;
cin violatorName;
bool found false;
for int i ; i num; i
if ddiname violatorName
ddifineDeduction;
found true;
break;
if found
cout "Driver not found!" endl;
for int i ; i num; i
cout "Driver's name: ddiname endl;
cout "Driver's salary: ddisalary endl;
double salarySum calculateSalarySumdd num;
cout "Total salary sum: salarySum endl;
delete dd;
double TheCost;
char BusMaintenance;
cout Does the bus need maintenance Y N ;
cinBusMaintenance;
if BusMaintenance Y BusMaintenance y
cout how much does it cost;
cinTheCost;
cout "The profit earned by the bus : printiname;
cout "Enter phoneNumber of student: ;
cin printiphoneNumber;
cout "Enter neighbourhood of student: ;
cin printinuberhode;
cout "Enter payments the student pays this month: ;
cin printipayments;
if printipayments
count;
size count;
void bubbleSortaccounts print int size
for int i ; i size ; i
for int j ; j size i ; j
if printjpayments printj payments
accounts temp printj;
printj printj ;
printj temp;
void outputDataaccounts print int size
for int i ; i size; i
cout "Name of the student: printiname endl;
cout "phoneNumber of the student: printiphoneNumber endl;
cout "Neighbourhood of the student: printinuberhode endl;
cout "Payments the student pays this month: ;
cout printipayments endl;
int calculatePaymentSumaccounts print int size
int sum ;
for int i ; i size; i
sum printipayments;
return sum;
double calculateSalarySumdriver drivers, int num
double sum ;
for int i ; i num; i
sum driversisalary;
return sum;
and this is the requirement There should be a company called AlBarq for bus repair, cooperating with the president of a company called Shams Buses to transport students.
So that all drivers employed by the President of Shams Company deal with Al Barq Company to repair their cars
There is a wonderful advantage that the driver who takes care of his car with a weekly routine at the end of the month will be the employee of the month and will have a bonus to his salary and a discount with the lightning company and it printed
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started