Question: 7. The following program is written to get a software details from the user. Write a code to complete the program based on the instructions

7. The following program is written to get a software details from the user. Write a code to complete the program based on the instructions given. #include #include using namespace std; class software { string name; int id,qtty; float price,total; public: (i) { } (ii) { } (iii) { } (iv) { } }; int main() { software s; string name; int id,qtty; float price; cout<<"Enter software name :"; getline(cin,name); cout<<"Enter software quantity :"; cin>>qtty; cout<<"Enter software ID :"; cin>>id; cout<<"Enter software price :"; cin>>price; s.setdata(name,id,qtty,price); s.calculate_total();

s.display(); } Sample Output A list of computer software. Enter software name :Microsoft Word Enter software quantity :4 Enter software ID :112211 Enter software price :345.00 Software Name :Microsoft Word Software Quantity :4 Software ID :112211 Software Price :RM 345 Total :RM 1380 -------------------------------- i. Write a function called setdata() that has four parameters and initialize the parameters to name, id, qtty and price. ii. Write a function called calculate_total() that calculate the total price. iii. Write a function called display() that display all information as shown in the sample output. iv. Write a constructor for class software that displays a welcome note A list of computer software.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!