Assignment
1 2022
(Questions)
, COS1511/103/0/2022
1 Assignment 1: 2022 SUBMISSION:
Electronically via myUnisa
Please note that we automatically give five days extension for this assignment. It will be to
your own advantage to check after a few days whether the assignment has been registered on
the system. If you have not completed the assignment by the extension date, submit whatever
you have completed – you will get marks for everything that you have done.
If myUnisa is off-line when you want to submit the assignment, you need not contact us,
because we will be aware of it. Simply submit it as soon as myUnisa is available again.
DUE DATE 20 April 2022
UNIQUE NUMBER 830138
EXTENSION There is an automatic extension until 25 April. You do
not need to phone or send an e-mail to request
automatic extension
TUTORIAL MATTER Study Guide, Lessons 1 – 16
CONTRIBUTION WEIGHT TO 20%
SEMESTER MARK
QUESTIONS Practical exercises
IS YOUR SOFTWARE INSTALLED?
Look at ‘Troubleshooting’ under ‘Using the software’ in file index.html on Disk2016.
If you struggle to install the software, please contact your e-tutor.
Question 1
Find a good cookbook. Read the instructions for your favourite dish. Write a program to display the recipe on the
screen but with a difference. The quantity of each ingredient must be multiplied by a value entered from the
keyboard.
For example, if the recipe needs 2 cups of flour the output displayed will be something like this
Please enter the factor to multiply the ingredients with : 4
Recipe name
Ingredients
// other ingredients
8 cups flour
Method
The program has the following structure:
• Declare an int variable named mFactor to store the value with which the quantity of each ingredient
must be multiplied.
• The program must make use of a cin statement to input a value from the keyboard and store it in
mFactor.
Submit both your program and output.