+ 1
Can you do this using if statement
Create a program that can determine whether a given number of students for a class is to be retained ,closed or divide into several blocks. This will be the output. get the numbers of student in the user get subject title from user. if the number of enrollees is <15 the class will be closed. if 15-30 the class will be retained. if its greater than 30 it will add one block
5 Answers
+ 2
in every 15 enrollees it will count as1 block and if u put 30 it will be 2 blocks but if its 45 it will be 3 blocks :)
+ 2
yes
+ 1
https://code.sololearn.com/cu8tAsxcF6as/?ref=app
I hope it inspires you to complete it. I have learnd c++ in school 8 years ago. I think there are some mistakes i will try it simultanously with you. The conversions are making me "nervous". A bit. Thanks for the opportunity to do some c++.
I am off.
Good night
0
after adding one block: Does the first full block shall be ignored or counted how many complete block there are?
0
I am from germany as you may have seen in my profile. It is a bit late here but i will give you your if with pleasure tommorrow if you can wait.
There is still one question:
Is this right? :
-------------------------------------------------------------
One class can only exist if there are 15 or more enrollees.
ONLY if there are 15 enrollees there will be ONLY one block. In all other cases with more enrollees there will be 2 or more blocks.
if there are 16 enrollees the class won't be closed and there are two blocks of this class with each having 8 enrollees.
if there are 30 enrollees there will be exactly two complete blocks. The output of the method will be something like:
"There are two complete blocks of the class "classname".
if there are 34 enrollees there will be three blocks of [12 / 11 / 11 ]
------------------------------------------------------------------
i hope i got it