Clo 2 Show Simple Programs By Developing Code To Solve Problems In A Computer Using C Programming Language P2 Plo 1 (63.19 KiB) Viewed 30 times
Clo 2 Show Simple Programs By Developing Code To Solve Problems In A Computer Using C Programming Language P2 Plo 2 (33.07 KiB) Viewed 30 times
CLO 2: Show simple programs by developing code to solve problems in a computer using C++ programming language. (P2, PLO 3) TOPIC: 5.2: DEFINE THE FUNCTION PROTOTYPES 5.3: SHOW THE PARAMETERS/ARGUMENTS PASSING TECHNIQUES DURATION: 9.5 HOURS INSTRUCTION: ANSWER ALL THE QUESTIONS TS Group Sdn. Bhd. has opened a new branch in the business involving t-shirts to be sold online named TS Online Shop. To launch the business, the company has hired a system developer to develop a t-shirt ordering system using C++ programming language. This system will use the following functions: 1) inputData() function. This function is to accept customer's name, phone number and address. 2) Create a calculatePrice() function with 2 arguments which is product code and quantity; and return value price. 3) Create a calculate Discount() function with 1 argument i.e. the total price and the return value for a 10% discount. Discount is only given if the purchase exceeds rm100. 4) Create a displaySummary() function with 3 arguments which is product code, total price and discount; and no return value. This function will be display information about customer and the product details. 5) Main function. This function will call all the appropriate functions to complete the program.
doutput as in Figure 1 below WELCOME TO TS ONLINE STORE Product Code Tshirt Type 1001 Short Sleeve 1002 Long Sleeve 1003 Muslimah Enter Name : MUHAMAD ALIF NAIMI Enter Phone Number: 011-1234567 Enter Address: NO 20, TAMAN SUTERA MANGE, MELAKA Enter Product Code : 1002 Enter Quantity : 5 ORDER DETAILS Name MUHAMMAD ALIF NAME Address: NO 20, TAMAN SUTERA WANGT, MELAKA Phone No: 011-1234567 Product Details Product Code Total Price (RM) 175.00 2 17.50 Discount (8) Price to be paid (RM) THANK YOU... PLEASE COME AGAIN Insert order for new customer? (x/m): Figure 1 Price (2) 30.00 35.50
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!