0% found this document useful (0 votes)
11 views7 pages

Null

This document contains 12 multiple choice questions related to coding concepts like variables, data types, calculations, and pseudocode. The questions cover topics such as calculating percentages, amounts, numbers of items based on given variables and inputs. Pseudocode is provided for some questions to help determine the correct calculation or code statement.

Uploaded by

Thethani Nzuza
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views7 pages

Null

This document contains 12 multiple choice questions related to coding concepts like variables, data types, calculations, and pseudocode. The questions cover topics such as calculating percentages, amounts, numbers of items based on given variables and inputs. Pseudocode is provided for some questions to help determine the correct calculation or code statement.

Uploaded by

Thethani Nzuza
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

1.

Write a code that will ask the user to enter a cost of a dozen of eggs and the
number of dozens they want to buy. Calculate and display how much they will
make if they sell a certain number of eggs with a selling price that can be
obtained. Calculate and display the percentage of eggs that were sold and the
percentage of eggs left.
Considering the following piece of pseudocode:

When the user clicks the green flag


// Declare fixed values
// Input
ask "How many dozens of eggs did the user buy? "
enter iNumDozens
ask "How much is a dozen? "
enter rDozenCost
ask "How many eggs did you sell? "
enter iNumSold
ask "How much is a single egg? "
enter rEggPrice
// Processing
….

Which statement will calculate the percentage of eggs left if the percentage sold
(rPercentSold) is known? Store your answer in rPercentLeft .

Choose the correct answer:

a) rPercentLeft=(iNumSold-iNumDozen)/rPercentSold
b) rPercentLeft=100.00+rPercentSold
c) rPercentLeft=100.00-rPercentSold
d) rPercentLeft=iNumSold-rPercentSold

Consider the following algorithm:


what statement is true

a) All the steps can be swopped


b) If we swop line 13 and 14 the algorithm will produce wrong output values
c) We can only swop 7, 8 with 11 and 12
d) We cannot swop line 7 and 8

3. Yohan is making a fruit punch for his party. The bowl for the fruit punch will hold a
certain number of litres. The local shop only sells fruit juice in containers of 150 ml.

rNumLitres: number of litres needed for the punch


iNumBottles : number of bottles he must buy

BOTTLESIZE=150
If he buys 45 containers, and 70 litres is needed to fully fill the bowl; how many litres
will he still need to fill the bowl? You can store the answer in rRemLitres.

Considering the following pseudocode statement using variables names only :


A. rRemLitres=rNumLitres-iNumBottles* BOTTLESIZE/1000
B. rRemLitres=rNumLitres % (iNumBottles* BOTTLESIZE)/1000

a) Neither A nor B is correct


b) Only A is correct
c) Only B is correct
4. You are asked to set out the school hall for an event. You are working out how
many rows of seats you can safely get in the 20.8 m from the back of the hall to the
stage. Each chair takes up a certain number of cm and you must leave another 0.72m
for legroom. you must also leave a 1 metre gap at the back of the hall. How many
rows can you fit in?

iNumRows: number of rows that can fit in the hall


rChairCm: cm taken by a chair

The correct processing is:

a) iNumRows= 20.8/(rChairCm/100+0.72)
b) iNumRows= (20.8*100 – 100)/(rChairCm+0.72*100)
c) iNumRows= 20.8/(rChairCm/100+0.72)*100
d) iNumRows= 20.8*100 - 100/(rChairCm+0.72)

5. Mrs Stone is tiling her new kitchen floor. The kitchen height, width and length are
all in meters and can be obtained . The size of the tiles (in squared cm) she has chosen
will also be provided. How many tiles will Mrs Stones need to buy to cover her kitchen
floor (only full tiles can be bought).
The following variables names are used:

Considering the above problem statement: if


iTileSize =121
rRoomLength =3.5
rRoomWidth =3
rRoomHeight=2.5

How many tiles must Mrs Stone buy?


a) 9
b) none of the above
c) 867
d) 868

6. Mrs Stone is tiling her new kitchen floor. The kitchen height, width and length are all in meters and can
be obtained . The size of the tiles (in squared cm) she has chosen will also be provided. How many tiles
will Mrs Stones need to buy to cover her kitchen floor (only full tiles can be bought).
The following variables names are used:

Considering the above problem statement, what is the data type of the output
a) integer
b) real
c) string

7. Luke was given a certain amount as a gift. He wants to buy as many CD's as he can. Each CD costs R9.
How many can he buy? ( for example, how many CD will a customer get if he has R100):
You can use the following variables
Amount given (rAmount)
Number of CD (iNumCD)
Considering the above problem, the following is true:
a) The output can be calculated and is rAmount=iNumCD*9
b) The amount given is the input and iNumCD=rAmount\9
c) iNumCD=rAmount/9 and 9 can be used as a constant
d) The input is 9 and iNumCD=rAmount/9

8. Using the following formula, you can calculate the temperature in Celsius after obtaining the
temperature in Fahrenheit:

rCelsius = (rFahrenheit - 32) * 5 / 9


The input is :
a) 32
b) rFahrenheit
c) 32 and 5/9
d) rCelsius

9. You are asked to set out the school hall for an event. You are working out how many rows of seats you
can safely get in the 20.8 m from the back of the hall to the stage. Each chair takes up a certain number
of cm and you must leave another 0.72m for legroom. you must also leave a 1 metre gap at the back of
the hall. How many rows can you fit in?

iNumRows: number of rows that can fit in the hall


rChairCm: cm taken by a chair
Type a single statement in pseudocode that will display exactly the following output when iNumRows is
50:
The number of rows that can fit in is: 50

Answer:

10. Write a code that will ask the user to enter a cost of a dozen of eggs and the number of dozens they
want to buy. Calculate and display how much they will make if they sell a certain number of eggs with a
selling price that can be obtained. Calculate and display the percentage of eggs that were sold and the
percentage of eggs left.

Considering the following piece of pseudocode

When the user clicks the green flag


// Declare fixed values
// Input
ask "How many dozens of eggs did the user buy? "
enter iNumDozens
ask "How much is a dozen? "
enter rDozenCost
ask "How many eggs did you sell? "
enter iNumSold
ask "How much is a single egg? "
enter rEggPrice
// Processing
….
Write the statement that will calculate the amount raised after selling a certain number of eggs. You can
store the money made in rAmount. ( Do not leave space between your variables and operators)

Answer:

11. Write a code that will ask the user to enter a cost of a dozen of eggs and the number of dozens they
want to buy. Calculate and display how much they will make if they sell a certain number of eggs with a
selling price that can be obtained. Calculate and display the percentage of eggs that were sold and the
percentage of eggs left.

Considering the following piece of pseudocode

When the user clicks the green flag


// Declare fixed values
// Input
ask "How many dozens of eggs did the user buy? "
enter iNumDozens
ask "How much is a dozen? "
enter rDozenCost
ask "How many single eggs did you sell? "
enter iNumSold
ask "How much is a single egg? "
enter rEggPrice
// Processing

Complete the following code that attempts to calculate the percentage of eggs sold.

rPercentSold=__________ /(iNumDozen*___)*100

Answer:

12. Considering the following pseudocode, select all the input variables
a) rKennel_Exercise
b) rCostFoodDay
c) rKennelFee
d) iNumdays
e) rTotalFood

13. Considering the following pseudocode, select all the output variables.

a) rKennel_Exercise
b) iNumdays
c) rCostFoodDay
d) rKennelFee
e) rTotalFood

You might also like