Sarah Sulaiman
#include <iostream>
#include<iomanip>
using namespace std;
void welcome();
void Get_userInput (char edition, char choiceMember, char cover, char chosen,char member, string name , int charge, int charge_member , int quantity, int pass );
void calculate_order (char edition,char cover, double sum , double rate, int quantity);
void discount_Member (int year,double sum );
void display_output();
int main ()
{
char edition, cover, chosen,member,choiceMember,ans;
string name, id;
int charge, charge_member, quantity, pass,year, c;
double rate, sum;
float discount;
void welcome();
cout <<"\t\t------------------------------------------------------------------------\n\n";
cout <<"\t\t WELCOME TO MIRA PUBLICATION ORDERING SYSTEM "<<endl<<endl;
cout <<"\t\t------------------------------------------------------------------------\n\n";
cout <<"\t\t MIRA PUBLICATION IS SELLING MATHEMATICS BOOKS ONLINE";
void Get_userInput(char edition, char choiceMember, char cover, char chosen,char member, string name , int charge, int charge_member , int quantity, int pass);
{
getline(cin,name);
cout<<"Enter your name:";
getline(cin,name);
for(int i = 0 ;i<name.length();i++)
{
name[i]=toupper(name[i]);
}
do
{
for (int s=1;s<=2;s++)
{
cout <<"\n ENTER APP LOG IN PASS (1 2) BEFORE PROCEED";
cin>> pass;
}
cout<< "\n NOW CAN PROCEED TO SYSTEM";
cin>>ans;
}while(ans== 'N'|| ans== 'n');
{
cout <<"\n do you have membership? ( Y || N )";
cin>>chosen;
if(chosen=='Y')
{
cout<< "yes"<<endl;
cout<<"enter your membership id";
cin>>id;
cout<<"\nMembership ID="<<id<<endl;
}
if (chosen == 'N')
{
cout <<"\n Do you want to register for membership? A OR B ";
cin>> choiceMember;
switch (choiceMember)
{
case 'A':
case 'a':
cout<<"\nfor how many years you wish to be a member?"<<endl;
cin>> year;
charge = 5;
charge_member = year*5;
cout<<"\nmembership fee:"<<charge_member<<endl;
case 'B':
case 'b':
cout<<"\nfor how many years you wish to be a member?"<<endl;
cin>> year;
charge= 0;
charge_member =year*0;
cout<<"\n membership fee:"<<charge_member<<endl;
}
}
}
}
void calculate_order(char edition,char cover, double sum , double rate, int quantity);
{
if(edition == 'L' && edition == 'l')
{
if (cover == 'S')
rate =60;
else
rate= 80;
}
else
{
if (edition == 'I' && edition == 'i' )
{
if (cover == 'S')
rate = 110;
else
rate=130;
}
}
sum=rate*quantity;
}
void discount_Member(int year,double sum);
{
if (year>=1&& year<=5)
{
cout<<"You will get 5% discount/n";
discount = (sum- (sum*0.05));
cout<< "price after discount is :RM/n"<<discount;
}
else if (year>5&&year<=10)
{
cout<<"you will get 10% discount/n";
discount = (sum-(sum*0.10));
cout<<"price after discount is :RM/n"<<discount;
}
else if (year>=11)
{
cout<<"you will get 15% discount/n";
discount = (sum-(sum*0.15));
cout<<"price after discount is : RM/n"<<discount;
}
else
{
cout<<" No member discount/n";
discount = sum;
cout<<"price after discount is :RM/n"<<discount;
}
}
cout<<"\n\n*************************"<<endl;
cout<<"INVOICE FOR:"<<name<<"\n\n";
cout<<"Book: Mathematics book\n";
cout<<"book edition (L-local , I-international)";
cin>>edition;
cout<< "cover book (H-hard , S-soft)";
cin>>cover;
cout<<"\nmembership FEE:RM\n"<<charge_member;
cout<<"\nPrice book per unit : RM\n"<<rate;
cout<<"\nPrice book with quantity:RM\n"<<sum;
cout<<"\nPrice after discount is: RM"<< discount;
cout<<"\n\n""************************"<<endl;
}
MᏫᎻᎯᎷᎷᎬᎠ
How will be names lookup in C++20 modules?!
I mean
You define a module A in file b.cpp
And then you import A; in file main.cpp
How does the compiler know the module location, unless you supply that information as an arguments with g++, but it's a little bit painful if you have tens of files
In the include system you specify only the path, so it's known to the pre-processors
Mawut
Hello guys, I came across an Object-Oriented programming based question. I have been trying to figure out which one to make the base and derived classes and I really got confused. Please give me a head up on how I can tackle the question.I don't need the code, just the frame
Here is the question
A car bazaar deals in various types of vehicles including cars, vans, buses, minibuses, trucks, pickups among others. A bazaar management program is required to keep track of these vehicles and the activities that happen to them. The bazaar also assigns employees to be responsible for the marketing, sales and maintenance as well as security services for these vehicles. Assume the bazaar operates within Nairobi and has at least three branches.
Required:
A design of the said program clearly outlining classes (base and derived) and their corresponding data members as well as any relationship between the classes.
A program to:
Keep track of which vehicle is in which branch at any particular time.
Keep track of which employee is in which branch
Which employee has worked on (marketed, sold or repaired) which vehicle.
Using C++ and employing OOP concepts, implement the required program, clearly outlining how you have used the concepts of: Classes, Objects, Encapsulation, and Inheritance.
Manish
Mα∂ɦµ void allocHealthChecker(const std::string& yaml) {
health_checker_ = std::make_shared<TestHttpHealthCheckerImpl>(
*cluster_, parseHealthCheckFromV2Yaml(yaml), dispatcher_, runtime_, random_,
HealthCheckEventLoggerPtr(event_logger_));
}
Error is at HealthCheckEventLoggerPtr(event_logger_));