100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Exam (elaborations)

COS1511 Assignment 1 2022

Rating
-
Sold
-
Pages
7
Grade
A+
Uploaded on
27-06-2022
Written in
2021/2022

COS1511 Assignment 1 2022 (Questions) A teacher at Leva Primary School needs to divide her class in different group sizes according to the activity they have to do. This will help her to prepare workstations for each group. For example, for art projects the class has to be divided in groups of 6; for science projects the class has to be divided in groups of 4. She asked you to write a program to determine the number of groups as well as the number of pupils who are left to form a smaller group. There are 56 pupils in the class. The program has the following structure: • Declare three int variables nrPupils, nrGroups, and nrLeft. nrPupils represents the number of pupils in a class, nrGroups represents the number of groups the class is divided into, and nrLeft represents the number of pupils, if any, who are in the remaining smaller group. • Assign the value 56 to nrPupils. • Declare an int variable groupSize that is used by a cin statement to input a value from the keyboard and store the size of the groups the teacher requested. Display an appropriate message. E.g. Please enter the size of each group? • Write the statement to calculate the number of groups of size groupSize. • Write the statement to calculate the number of pupils who are in the remaining smaller group. The output of the program must be displayed as follows: There are 9 groups consisting of 6 pupils There are 3 remaining pupils Submit both your program and output Question 3 . You are requested to write a very simple calculator. Your calculator should be able to handle the five basic mathematic operations – add, subtract, multiply, divide and modulus – on two input values. Your program should have the following structure: • Ask the user to enter two float variables named var1 and var2 • Ask the user to enter a character variable named operation to represent the operation to be performed on the two variables. • Perform the appropriate operation by using if-statements • The output must be given in fixed-point notation with two digits after the decimal point.

Show more Read less









Whoops! We can’t load your doc right now. Try again or contact support.

Document information

Uploaded on
June 27, 2022
Number of pages
7
Written in
2021/2022
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

Content preview

COS1511
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.

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
SOLUTIONS2024 Chamberlain College Of Nursing
View profile
Follow You need to be logged in order to follow users or courses
Sold
906
Member since
3 year
Number of followers
696
Documents
5458
Last sold
4 days ago
ALPHA STUDY CENTRE.

Alpha Academy is a dedicated study centre where you will find QUALITY & RELIABLE study resources that will help you prepare, revise and pass your examinations for all majors and modules in real TIME.. Good Luck from ALPHA ACADEMY.

3,7

180 reviews

5
91
4
26
3
19
2
7
1
37

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their exams and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can immediately select a different document that better matches what you need.

Pay how you prefer, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card or EFT and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions