[go: up one dir, main page]

0% found this document useful (0 votes)
48 views12 pages

Proposal C++ Assignment

Uploaded by

ikmal hakim
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)
48 views12 pages

Proposal C++ Assignment

Uploaded by

ikmal hakim
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/ 12

MTM3054 PROGRAMMING LANGUAGE (K2)

PROPOSAL ASSIGNMENT
TOPIC: ELECTRONIC DEVICE BUSINESS
GROUP 2
NAME MATRIC NO.
PUAH YAN ZHEN S68096
LIM JIT SHENG S65611
WISMOND LIM JIA JING S66004
TAN KAI HAN S67304
Topic: Electronic Devices Business

An electronic device store, Machine Device Store, was recently opened. Machine Device
Store sells various types of electronic devices, which are smartphones, tablets, and
smartwatches with different brands. The brand companies, mainly Apple, Samsung,
HuaWei sponsored and cooperated with the store for selling products of the companies.
Since the store is newly opened, a promotion is held, and the accessories will be sold as
add-ons if customers have purchased the products of the store. The accessories also are
sponsored by companies like JBL, UGreen and others. The add-ons are 40% off and are
available to customers once they have purchased the products of the store. To be noted,
only 1 add-on is available per customer after the products are purchased.

The products sold in Machine Device Store:

Smartphones: -
Brand Apple
Model iPhone 15 Pro Max iPhone 15 iPhone 14
Price RM6,499 RM4,899 RM4,299
Brand Samsung
Samsung Galaxy S23 Samsung Galaxy Z Samsung Galaxy Z
Model
Ultra Flip5 Fold5
Price RM5,699 RM4,499 RM6,799
Brand HuaWei
HuaWei Nova 11
Model HuaWei P60 Pro HuaWei Mate X3
Pro
Price RM4,699 RM8,888 RM2,599
Tablets: -

Brand Apple
Model iPad Pro iPad Air iPad 10th Gen
Price RM5,899 RM3,649 RM2,749
Brand Samsung
Samsung Galaxy Tab Samsung Galaxy Samsung Galaxy
Model
S9 Ultra Tab S9 FE+ Tab A9+
Price RM5,999 RM3,399 RM1,099
Brand HuaWei
HuaWei MatePad
Model HuaWei MatePad Pro HuaWei MatePad
Air
Price RM4,299 RM2,799 RM1,499

Smartwatches: -

Brand Apple
Model Apple Watch Series 9 Apple Watch Ultra 2 Apple Watch SE
Price RM3,299 RM3,799 RM1,199
Brand Samsung
Samsung Galaxy Samsung Galaxy Samsung Galaxy
Model
Watch6 Classic Watch4
Price RM1,499 RM1,499 RM799
Brand HuaWei
HuaWei Watch 4 HuaWei Watch GT
Model HuaWei Band 8
Series 4
Price RM2,499 RM1,699 RM199
Add-ons (40% off): -
Original Price RM256
Brand new power adapter with type-C cable
40% off RM154
Original Price RM1,999
New high-quality wireless on-ear headphones
40% off RM1,200
Original Price RM219
New high quality wireless earbuds
40% off RM132
Original Price RM239
Silicone phone cases
40% off RM144
Original Price RM219
Magnetic wireless charger
40% off RM132
Original Price RM1,499
Portable bluetooth speaker
40% off RM900

Flowchart

To build the system of the business with the promotion, a flowchart is created as the
following: -

Pseudocode
A pseudocode is created before the coding begins. It shows the flows of the following
algorithms as things go successful.

The pseudocode is on the other file since it is too long.


START

DECLARE
deviceType, brand,
model, addOn,
modelAmount, subtotal,
totalPrice

DECLARE and INITIALISE


A, B, C, B1, B2, B3,
PM11, PM12, PM13, PM21, PM22, PM23,
PM31, PM32, PM33,TM11, TM12, TM13,
TM21, TM22, TM23, TM31, TM32, TM33,
WM11, WM12, WM13, WM21, WM22, WM23, WM31,
WM32, WM33, PP11, PP12, PP13, PP21, PP22, PP23,
PP31, PP32, PP33, TP11, TP12, TP13, TP21, TP22,
TP23, TP31, TP32, TP33, WP11, WP12, WP13,
WP21, WP22, WP23, WP31, WP32, WP33,
A1, A2, A3, A4, A5, A6,
AP1, AP2, AP3, AP4, AP5, AP6

PRINT
to introducing the store
and show products and
promotions

PRINT "If you have


purchased the products
of our store, an add-on with
discount is available!"

PRINT
PRINT "Invalid input.
to ask user for the
Try again."
device type

otherwise

A is entered C is entered
PRINT the device A PRINT the device C
deviceType
chosen chosen

B is entered
PRINT PRINT
the brand options PRINT the device B the brand options
of phones chosen of the device
PRINT PRINT
to ask user for PRINT "Invalid input. to ask user for PRINT "Invalid input.
the brand Try again." the brand Try again."
of phones of the device
otherwise otherwise

B1 is entered B3 is entered B1 is entered B3 is entered


PRINT the brand B1 PRINT the brand B3 PRINT the brand B1 PRINT the brand B3
brand brand
chosen chosen chosen chosen

B2 is entered B2 is entered
PRINT PRINT PRINT PRINT
the model options PRINT the brand B2 the model options the model options PRINT the brand B2 the model options
of phones chosen of phones of phones chosen of phones

PRINT PRINT
PRINT PRINT PRINT PRINT
PRINT "Invalid PRINT "Invalid
to ask user for the to ask user for the to ask user for the to ask user for the
the model options input. the model options input.
model of phones model of phones model of phones model of phones
of phones Try again." of the device Try again."

PRINT PRINT
"Invalid input. "Invalid input.
PRINT PRINT PRINT PRINT
model Try again." to ask user for the "Invalid input. model model Try again." to ask user for the "Invalid input. model
model of phones Try again." model of the device Try again."

otherwise otherwise
PM11 PM31 WM11 WM31
PRINT the model PRINT the model PRINT the model PRINT the model
PM11 chosen PM31 chosen WM11 chosen WM31 chosen

model model
PM12 PM32 WM12 WM32
PRINT the model PRINT the model PRINT the model PRINT the model
PM12 chosen PM32 chosen WM12 chosen WM32 chosen

PM22 WM22
PM13 PM33 WM13 WM33
PRINT the model PRINT the model PRINT the model PRINT the model
PM13 chosen PRINT the model PM33 chosen WM13 chosen PRINT the model WM33 chosen
PM22 chosen WM22 chosen
PM21 PM23 WM21 WM23

PRINT the model PRINT the model PRINT the model PRINT the model
PM21 chosen PM23 chosen WM21 chosen WM23 chosen

PRINT PRINT
to ask user to ask user
for the amount of for the amount of
model purchased model purchased
modelAmount = 0 otherwise otherwise modelAmount = 0
PRINT "Invalid input. PRINT "Invalid input.
modelAmount modelAmount
Try again." Try again."

modelAmount > 0 modelAmount > 0


PRINT "Since you have not PRINT "Since you have not
purchase the product PRINT the model of PRINT the model of purchase the product
of the store. Therefore device and the amount device and the amount of the store. Therefore
you cannot purchase purchased purchased you cannot purchase
any add-ons available." any add-ons available."

subtotal = subtotal =
modelAmount * modelAmount *
(respective price PP) (respective price WP)

PRINT
PRINT the subtotal the brand options PRINT the subtotal
price of the model of the device price of the model
purchased purchased

PRINT
PRINT
to ask user for
"Invalid input.
the brand
Try again."
of the device
otherwise

B1 is
entered B3 is entered
PRINT the brand B1 PRINT the brand B3
brand
chosen chosen

B2 is entered
PRINT PRINT
the model options PRINT the brand B2 the model options
of phones chosen of phones

PRINT PRINT PRINT


to ask user for the to ask user for the "Invalid input.
model of phones PRINT model of phones Try again."
the model options
of the device

PRINT
"Invalid input. model model
PRINT PRINT
Try again." to ask user for the "Invalid input.
model of the device Try again."
otherwise
TM11 TM31
PRINT the model PRINT the model
TM11 chosen TM31 chosen
model

TM12 TM32
PRINT the model PRINT the model
TM12 chosen TM22 TM32 chosen

PRINT the model


TM22 chosen
TM13 TM33
PRINT the model PRINT the model
TM13 chosen TM33 chosen
TM21 TM23

PRINT the model PRINT the model


TM21 chosen TM23 chosen

PRINT
to ask user
for the amount of
model purchased

modelAmount = 0 otherwise
PRINT "Invalid input.
modelAmount
Try again."

modelAmount > 0
PRINT "Since you have not
purchase the product PRINT the model of
of the store. Therefore device and the amount
you cannot purchase purchased
any add-ons available."

subtotal =
modelAmount *
(respective price TP)

PRINT the subtotal


price of the model
purchased
PRINT
the add-on
options and the price after
discount and the discount

PRINT to ask
user for add-ons

A1 otherwise
PRINT the add-on A1 PRINT "Invalid input.
addOn
chosen Try again."

A2 N
PRINT the add-on A2 PRINT for
chosen no add-on chosen

A3 A6
PRINT the add-on A3 PRINT the add-on A6
chosen chosen
A4 A5

totalPrice = PRINT the add-on A4 PRINT the add-on A5 totalPrice =


subtotal + AP3 chosen chosen subtotal + AP6

totalPrice = totalPrice = totalPrice =


totalPrice = subtotal
subtotal + AP2 subtotal + AP4 subtotal + AP5

PRINT
totalPrice =
the model of the
subtotal + AP1
device chosen

PRINT the model of the PRINT


device chosen and "... and you have
the total price of not purchase
all purchased any add-on."

PRINT "Thank you for PRINT the total


patronage! Please come price of
again." all purchase
END
Possible outcomes

The customers would understand how the promotion works. The customer is able to buy
only 1 accessory with 40% off as add-on after purchasing the products of the store. To
be noted, the add-on is sold per customer.

In the system, we introduce our electronic device store to the customers and ask for
choices from them. We sell smartphones, tablets, and smartwatches. After the customers
had chosen which types of devices they want, we ask for the brands of the devices:
Apple, Samsung, and HuaWei. We ask for the model of the devices and the amount of
the model desired after that. Note that we use do/while loop for invalid input and ask
again for the questions. We also use if/else if/else statement for every possible
input and switch at the model choosing.

The device types, brands, models, device prices, add-ons, and add-on prices are initialized
at the first step. We calculate the price subtotal after the devices are purchased:
subtotal = (model amount) * (respective price).

We ask for choosing add-on and calculate the total price of devices and add-ons.
total price = (subtotal) + (respective add-on price).

After everything is done, we thank customers for patronaging.

Note that, we use codes as string to initialize variables and for customers to choose.

Codes Meaning Examples


A, B, C Types of devices Smartphone, tablet, smartwatch
B1, B2, B3 Brands Apple, Samsung, HuaWei
PM11, PM12, … Phone models iPhone 15 Pro Max, …
TM11, TM12, … Tablet models iPad Pro, iPad Air, …
WM11, WM12, … Watch models Apple Watch Series 9, …
PP11, PP12, … Phone prices
TP11, TP12, … Tablet prices
WP11, WP12, … Watch prices
A1, A2, A3, … Add-ons On-ear headphone, …
AP1, AP2, AP3, … Add-on prices
References

1. Apple Store. https://www.apple.com/my/


2. Samsung Online Store. https://www.samsung.com/my/
3. HuaWei Online Store. https://www.huawei.com/my/
4. C++ Do/While Loops. GeeksforGeeks. https://www.geeksforgeeks.org/cpp-do-
while-loop/
5. Flowchart. Draw.io. https://app.diagrams.net/
6. Pseudocode for Beginners. Tech Geek Buzz.
https://www.techgeekbuzz.com/blog/how-to-write-pseudocode/
7. Pseudocode. Visual Studio Code.

You might also like