Create a new C++ empty project titled \"CS115_IP4_YourName\" in the IDE. Use 2 a
ID: 3785069 • Letter: C
Question
Create a new C++ empty project titled "CS115_IP4_YourName" in the IDE. Use 2 arrays: one for the products, and one for the quantities. Use loops to assign values to the arrays. Use loops to read and print values from the arrays. Reuse the functions that you developed in Week 2 and the customer class that you developed in Week 3. Changes can be done as needed. Complete the following in your code: Provide a list of available products Ask the customer to select products and quantities Save the provided details in arrays Read from the arrays to print the order summary; that is, the products, quantities, and the total price for each product Calculate and print the total price for the order. I need help writing this program can some one help me. I'm using dev c and i need it in english.
Create a new C++ empty project titled "CS115_IP3_YourName" in the IDE.
Design the customer class.
Include at least the customer name and address for the class.
Create class functions to set the class variables.
Create class functions to get the values of the class variables.
Create additional functions as necessary.
Complete the following in your code:
Implement the new class
Create an object from the new class
Set the customer details using the class functions
Use the class functions to access the customer details
Create a new C++ empty project titled "CS115_IP2_YourName" in the IDE.
Determine the functions that you need to create (you need at least 3).
Design and implement those functions in the IDE.
Your program should provide the following additional functionality (in addition to the functionality provided in Week1):
Ask customers to select multiple products and quantities
Print the order summary, including the products, the quantities, and the total price for each product
Calculate and print the total price for the order
Compile and run the application to demonstrate a working program.
Explanation / Answer
I have implemented the following parts:
Design the customer class.
Include at least the customer name and address for the class.
Create class functions to set the class variables.
Create class functions to get the values of the class variables.
Create additional functions as necessary.
Complete the following in your code:
Implement the new class
Create an object from the new class
Set the customer details using the class functions
Use the class functions to access the customer details
#include<iostream>
#include<string>
using namespace std;
//customer class
class customer
{
private:
//variable decleration
string cust_name;
string cust_addrs;
public:
//setter methods
void set_custName(string name)
{
cust_name = name;
}
void set_custAddrs(string addrs)
{
cust_addrs = addrs;
}
//getter methods
string get_custName()
{
return cust_name;
}
string get_custAddrs()
{
return cust_addrs;
}
};
int main()
{
//object creation
customer cust_obj;
//calling setter methods
cust_obj.set_custName("adam");
cust_obj.set_custAddrs("house no 10, park_street");
//calling getter methods
cout<<"Customer Name is: "<<cust_obj.get_custName().c_str()<<endl;
cout<<"Customer Address is: "<<cust_obj.get_custAddrs().c_str()<<endl;
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.