Lab Task 3 - Question

You might also like

You are on page 1of 4
NAME REGISTRATIONNO | MARKS DATE a [eas - 4 ‘CODEISUBJECT FC20113 - PROGRAMMING | 4 FUNDAMENTALS: 1 00 TAB TASK 3 LECTURER —_ CLO 2: Show simple programs by developing code to solve problems in a computer using C++ programming language. (P2, PLO 3) TOPIC: 3.2 SHOW PROBLEM USING SELECTION CONTROL STRUCTURES 3.3 SHOW PROBLEMS USING LOOPS CONTROL STRUCTURES DURATION: 2 HOURS INSTRUCTION: ANSWER ALL THE QUESTIONS QUESTION 1 i. Write a complete C + program to calculate the monthly bill for outgoing calls including the local and international call. The rate of calling is fixed at RMO.20 and RMO.50 per minutes for local and international calls, respectively. 6% service charge will be included in the total bill for a customer. (CLO2, P2) To do that, you may need to follow these steps a. Create variables. b. Declare each variable with the most suitable data type. c. Initialize variable with initial value if applicable. d. Write input statement to accept input from user. e. Using do..while and if..else statement, this program should be able to: + + Display "Invalid input” message when user enters minutes for local or international calls less than 0. Sample output as in Figure 1 eeu scar aeey C es vereC eying Coast eee Cece vereC ety ais Figure 1 {Using another do...while statement, allow the user to enter the character "Y" or "y" to continue. Otherwise, the program will be terminated. ii, Execute the program. (CLO2, P1) iii, Fix any error if occurred. Expected output as in Figure 2 and Figure 3. (CLO2, P2) a ee a Bt eee eer es rer CeCe ieee phone number : @12-3456789 cere eRe U RC Fa eee EL) international call in minutes : 20 Demet ee POM CR Ca ICs crore mere eT ED ag Srey aera iat Tate : RM 10 Monthly Outgoing Call Paid : RM 37 otal Monthly Paid Including Service Charge Cie peace st MEG ae ee Ura ey a SC Dye ee Teeny EE nter local call in minutes PBC ets local call in minut Reger etie aer eee Un eae PSEC Reus eet istu rae CSU ees) COBO RS La Greeters sme OMe FU ee) ieoeeebeeeeae Tn Te ers Ga eae Muhammad Amar Haikal bin Ahmad : @11-2233445 cing Call Paid As Belo 1 Local Call Total International Call aes Stace St Rea) Figure 3 NAME z REGISTRATION NO MARKS DATE GLASS ‘CODEISUBJECT DFC20113 - PROGRAMMING FUNDAMENTALS LAB TASK 3 100 LECTURER RUBRIC LABORATORY TASK 3 Performance ADVANCED INTERMEDIATE BEGINNER WEAK ea z . 7 x Weightage | score Allvariables are named with ‘Able to declare variables and most | Able to declare variables and some| Able to declare variables but all ae descriptive names and using the | of variables using descriptive ‘of variables using descriptive variable names are cryptic and 10 ©) | most suitable datatypes. names and suitable data types. | names and suitable data types. | using incorrect data types. ‘Student able to write allthe input | Student able to write most the | Studentable to write some the | Student able to write a few input Input & Output | output statements given and | input & output statements based | input & output statements based | & output statements but not Statement (P)_ | use correct symbol based on the | onthe scenario given and use _| on the scenario given but notin | based on scenario gwen, 20 scenario, correct symbol correct symbol Selection Students able to write code and | students able to write most ofthe | csent able townte some the | Student able to wre some the Control Use the correct selection contrl_| selection contol structures but | Stems abletciurte some the | Student able to write some the as Structures | structures and clearly solves does not derive a solution tothe | Ssiecton control structures with | selection con es e) the problem, problem. u ‘Students able to write most ofthe | Students able to write some the | Students able to write some the Loops Control | students able to writecode use igo control structures but does | loap cantal structures with minor | loop control structures with major Sens | tc eaetop contol atures morécivescoumonetie | ener was Le crenitation | Program withexpected output | programs with unexpected output. | minor errors major errors ecaton roran | 00% | 00 : a *Zero (0) mark will be given if students do not answer / perform the criteria needed. " F fua Progham |PPPT DH6d) tn

You might also like