100% tevredenheidsgarantie Direct beschikbaar na je betaling Lees online óf als PDF Geen vaste maandelijkse kosten 4,6 TrustPilot
logo-home
Tentamen (uitwerkingen)

COS1511 Introduction To Programming 1 Assignment 1 2022 (Questions).

Beoordeling
-
Verkocht
-
Pagina's
7
Cijfer
A+
Geüpload op
26-07-2022
Geschreven in
2021/2022

COS1511 Introduction To Programming 1 Assignment 1 2022 (Questions). 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 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 SEMESTER MARK 20% QUESTIONS Practical exercises IS YOUR SOFTWARE INSTALLED? Look at ‘Troubleshooting’ under ‘Using the software’ in file 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. COS1511/103/0/2022 3 Question 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. A typical run is displayed below: Please enter the first float value: 35.6 Please enter the second value: 24.12 Please enter the operation required : + The sum of 35.6 and 24.12 is 59.72 Submit both your program and output. Question 4 ...

Meer zien Lees minder
Instelling
Vak









Oeps! We kunnen je document nu niet laden. Probeer het nog eens of neem contact op met support.

Geschreven voor

Instelling
Vak

Documentinformatie

Geüpload op
26 juli 2022
Aantal pagina's
7
Geschreven in
2021/2022
Type
Tentamen (uitwerkingen)
Bevat
Vragen en antwoorden

Onderwerpen

Voorbeeld van de inhoud

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.

Maak kennis met de verkoper

Seller avatar
De reputatie van een verkoper is gebaseerd op het aantal documenten dat iemand tegen betaling verkocht heeft en de beoordelingen die voor die items ontvangen zijn. Er zijn drie niveau’s te onderscheiden: brons, zilver en goud. Hoe beter de reputatie, hoe meer de kwaliteit van zijn of haar werk te vertrouwen is.
EXCELLENTNURSE Chamberlain College Of Nursing
Volgen Je moet ingelogd zijn om studenten of vakken te kunnen volgen
Verkocht
1207
Lid sinds
3 jaar
Aantal volgers
991
Documenten
5530
Laatst verkocht
3 dagen geleden
TOP SELLER

Welcome All to this page. Here you will find ; ALL DOCUMENTS, PACKAGE DEALS, FLASHCARDS AND 100% REVISED & CORRECT STUDY MATERIALS GUARANTEED A+. NB: ALWAYS WRITE A GOOD REVIEW WHEN YOU BUY MY DOCUMENTS. ALSO, REFER YOUR COLLEGUES TO MY DOCUMENTS. ( Refer 3 and get 1 free document). I AM AVAILABLE TO SERVE YOU AT ANY TIME. WISHING YOU SUCCESS IN YOUR STUDIES. THANK YOU.

3,9

169 beoordelingen

5
95
4
23
3
21
2
6
1
24

Recent door jou bekeken

Waarom studenten kiezen voor Stuvia

Gemaakt door medestudenten, geverifieerd door reviews

Kwaliteit die je kunt vertrouwen: geschreven door studenten die slaagden en beoordeeld door anderen die dit document gebruikten.

Niet tevreden? Kies een ander document

Geen zorgen! Je kunt voor hetzelfde geld direct een ander document kiezen dat beter past bij wat je zoekt.

Betaal zoals je wilt, start meteen met leren

Geen abonnement, geen verplichtingen. Betaal zoals je gewend bent via Bancontact, iDeal of creditcard en download je PDF-document meteen.

Student with book image

“Gekocht, gedownload en geslaagd. Zo eenvoudig kan het zijn.”

Alisha Student

Veelgestelde vragen