Sarah Sulaiman
Hi
Sarah Sulaiman
You all can help me?
Sarah Sulaiman
My c++
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; }
Sarah Sulaiman
Can u all trace where is wrong?
Sarah Sulaiman
My output display like this...not correct
Sarah Sulaiman
I want display like this😭
Mar!o
#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; }
Nobody will read that fool
Mar!o
Mar!o
Jesus why I'm so angry today...
Anonymous
#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; }
I know everything happens for a reason but wtf
Anonymous
I'll take a look later on
Sarah Sulaiman
I'll take a look later on
Thank you...i really need the help
...
Hello and good morning. I need your help. Can someone explain this coding?🥺
...
...
Sorry for my bad english. 😅
...
I mean .. how does pointer and array work ? 🤔
Artöm
Who knows...
...
The pointer chapter .. for me, it's kinda hard understand😭.. just like, it can be swap wih the variable.. and .. I don't undersatnd🙂
...
And now .. it make me more not understanding .. ughhhhh
Mar!o
in the last line they iterate over array
Mar!o
a+n is the array end address
Mar!o
you can do pointer arithmetic like with an int
Anonymous
int 2 byte , char 1byte
...
Owhhh .. I see.
...
int 2 byte , char 1byte
I'm sorry. Can you explain, why char 1 byte 🤔 ... the coding show integer, right?😅
Anonymous
Google for search is better
...
Allright, thanks for help❤️😊
Artöm
int 2 byte , char 1byte
Int is usually 4, can be 2 or 8 as well
Dima
Lol
professor
is this real?
S@IF
For Linux Use GCC compiler >GCC filename.c >./a.out For window Install turbo c++, code block, dev c
Anonymous
#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; }
Пиздец
Anonymous
Thank you very much for welcoming me
MᏫᎻᎯᎷᎷᎬᎠ
Why virtual functions can't be a templates?
MᏫᎻᎯᎷᎷᎬᎠ
Well template functions instantiations are known at compile time🤷🏻‍♂
MᏫᎻᎯᎷᎷᎬᎠ
The overload resolution is known at link time
MᏫᎻᎯᎷᎷᎬᎠ
That's why
MᏫᎻᎯᎷᎷᎬᎠ
Yeah
MᏫᎻᎯᎷᎷᎬᎠ
Thanks Madhu
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
MᏫᎻᎯᎷᎷᎬᎠ
Or someone has to use Cmake Everytime huh!!
MᏫᎻᎯᎷᎷᎬᎠ
Okay Thanks again :)
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.
Mar!o
Manish
I am getting error like below error: no matching conversion for functional-style cast from 'std::unique_ptr<MockHealthCheckEventLogger>' to 'Envoy::Upstream::HealthCheckEventLoggerPtr' (aka 'unique_ptr<Envoy::Upstream::HealthCheckEventLogger>') where MockHealthCheckEventLogger is inherited from HealthCheckEventLogger. In my code event_logger_ is initialized as below std::unique_ptr<MockHealthCheckEventLogger> event_logger_{ std::make_unique<NiceMock<MockHealthCheckEventLogger>>()}; problem solved if I am using a raw pointer like MockHealthCheckEventLogger * event_logger_{ new MockHealthCheckEventLogger()}; I have to use a smart pointer here. Does anyone suggest how to implement that?
Hermann
a trivial question ... if I declare an array is large enough instead of accurately calculating its size do I have performance problems or something?
Manish
Mα∂ɦµ MockHealthCheckEventLogger is derived from HealthCheckEventLogger. and if I am using raw pointer there is no problem. Issues occur when using unique_ptr
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_));
Champion MVP
Hi
Manish
Thanks
Starz
Hey guys, is there anybody out there willing to help me out with my AfterEffects project. If so, please DM me.
Hermann
is it better to use a malloc or a fixed size with the problem of wasting memory?
Asdew
That depends.
Hermann
That depends.
if my data ever<1024... but i get problem of wasting memory
J.
Guys is there a way no to see these warnings on telegram ? All I see is warnings and bans?
Dima
Guys is there a way no to see these warnings on telegram ? All I see is warnings and bans?
if you would remove/restrict idiots from this groups, it will be a pleasure
J.
The thing is anybody can ask stupid questions but it is seriously annoying to read warnings and bans the rules everytime. Admins please take care of it it is ugly.
J.
It's a great platform I just told my opinion sorry I have no time for this because working on a lot of projects right now. Whatever.
Anonymous
You asshole
Dima
Lol
Mar!o
Anonymous
Fuck you
Anonymous
You asshole
Yes you are
Anonymous
Yes you are
Fuck you ass well
Dima
I am keeping it on
Anonymous
Mar!o
Dima
Lol
Dima
Anonymous
I can sort the array in O(1)
Mar!o
Who are we? Your workers?
Dima
Keep my laugh lmao
Anonymous
My friends
Mar!o
Keep my laugh lmao
😂🤣😂🤣😂🤣😂🤣😂😂
Anonymous
İ love you guys
Dima
İ love you guys
It’s easy you can do it!