Quiz 1 Flashcards

Quiz for Sessions 1 to 3 (4 cards)

1
Q

Product counter (3mins)

Multiple two inputs then get the length of their product.
Input:
100
100

Output:
Product: 1000
Length: 4

A

A

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Divisible by 7 (2mins)

Print the numbers from 20 to 100 that is divisible by 7

Output:
7
14
21

98

A

A

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Hourglass (6mins)

Ask the user for an input then print an hourglass where the top and bottom layers are composed of * corresponding to the user’s input. It should only allow an input of odd number, if the input is even, print an error message.
For the upper half layers, each layer should be two less than that of the layer above it.
For the lower half layers, each layer should be two more than that of the layer below it.

Input 1: 7

Output:
****
**
**
**
*
*
***
**

A

A

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

E-counter (6mins)

Print the numbers fifty to seventy and print how many times the letter e occurs in each number

Output:
Fifty: 0
Fifty-one

A

A

How well did you know this?
1
Not at all
2
3
4
5
Perfectly