0% found this document useful (0 votes)
52 views5 pages

PBT1 Question

This document contains a programming assignment to build a system for a cafe owner using C++. The system must: 1) Display a menu with prices and allow the user to select items. 2) Calculate subtotals, totals, discounts, and change owed. 3) Follow specific steps to build the system, including declaring variables, input/output statements, selection and loop controls. The student's work will be evaluated on correctly implementing these programming concepts.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
52 views5 pages

PBT1 Question

This document contains a programming assignment to build a system for a cafe owner using C++. The system must: 1) Display a menu with prices and allow the user to select items. 2) Calculate subtotals, totals, discounts, and change owed. 3) Follow specific steps to build the system, including declaring variables, input/output statements, selection and loop controls. The student's work will be evaluated on correctly implementing these programming concepts.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

NAME

REGISTRATION NO MARKS
DATE
CLASS
CODE/SUBJECT DFC20113 - PROGRAMMING

ASSESSMENT
FUNDAMENTALS
PROBLEM BASED TASK 1
100
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: 9.5 HOURS


INSTRUCTION: ANSWER ALL THE QUESTIONS

QUESTION 1

The owner of Hayati's Cafe, Puan Nor wanted a system that could display prices based on the
menu chosen by the customer. List of menus should be displayed on the top of the system with
their corresponding prices. Refer Table 1 for details.

SET A (RM 10.00) SET B (RM 20.00) SET C (RM 30.00)


Beef/Chicken Burger Plain rice Prawn Aglio Olio
Curly Fries Chicken Tomyam Slice of cake
Hot/Cold Drink Hot/Cold Drink Soft Drink
Table 1

As a programmer, you are tasked with building a system using the C++ programming language
that can help Puan Nor solve her problems. The system should also be able to formulate the
total price for each customer, display the cash received and calculate the balance. In addition,
Puan Nor also decided to give a 10% discount for orders over RM100 and must be entered into
the system. (CLO2, P2)
You may follow these steps to build the complete system:
a. Create variables.
b. Declare each variable with the most suitable data type.
c. Initialize variable with initial value if applicable.
d. Write the code to display the menu at the top of the system.
e. Write input statement to allow user to enter the selected menu.
f. Using the switch ... case statement, an "Invalid menu" message will appear when the
user enters the wrong menu. Refer to Figure 1. Users are also allowed to enter a
quantity for their order.
g. Using the do ... while statement, allow the user to enter the character "Y" or "y" to add
a new order. If there are no more orders, the system will display the total price, cash
received and calculate the remaining balance.
h. For orders over RM 100, a 10% discount will be automatically deducted from the total
price. You can use a single if statement to do that.
i. Compile and execute the program.
j. Correct any errors if they occur. The final output should be the same as in Figure 2 (if
only one menu is selected) & Figure 3 (if more than one menu is selected & has a
discount).

Figure 1
Figure 2
Figure 3
NAME
REGISTRATION NO MARKS
CLASS

100
CODE / COURSE NAME DFC20113 PROGRAMMING FUNDAMENTALS
LECTURER

RUBRIC PROBLEM BASED TASK 1

Performance ADVANCED INTERMEDIATE BEGINNER WEAK


Weightage Score
Area 4 3 2 1

Able to declare variables and Able to declare variables and


All variables are named with Able to declare variables but all
Declare most of variables using some of variables using
descriptive names and using the variable names are cryptic and 10
Variable (P) descriptive names and suitable descriptive names and suitable
most suitable data types. using incorrect data types.
data types. data types.

Students able to write all the Students able to write most the Students able to write some the Student not able to write the
Input & Output input & output statements given input & output statements based input & output statements based input & output statements
20
Statement (P) and use correct symbol based on on the scenario given and use on the scenario given but not in adequately based on scenario
the scenario correct symbol. correct symbol. given.

Selection Students able to write code and Students able to write most of
Students able to write some the
Control use the correct selection control the selection control structures Student not able to write or use
selection control structures with 25
Structures structures and clearly solves but does not derive a solution to the selection control structures.
minor errors.
(P) the problem. the problem.

Students able to write code use Students able to write most of Students able to write some the
Loops Control loop control structures with
the correct loop control the loop control structures but Student not able to write or use
Structures minor error. 25
structures and clearly solves the does not derive a solution to the the loop control structures.
(P)
problem. problem.

Code The code is exceptionally well


The code is readable only by
Readability organized and very easy to The code is poorly organized and
The code is easy to be read. someone who knows what it is 10
and Comment follow and include a few very difficult to read.
supposed to be doing.
(P) comments.
Program
Able to compile and execute the Able to compile and execute the
Compilation Able to compile the program with
program with expected output programs with unexpected Program is not working. 10
and minor errors.
and based on the scenario. output.
Execution (P)

TOTAL 100% / 100

*Zero (0) mark will be given if students do not answer/ perform the criteria needed.

You might also like