Examine the requirements and construct code, including the selection (if / switch) to fulfill the requirements stated in each part:
program prompts the user to enter the weight and age and determines the dosage of medicine according to the criteria.
[ AGE ] [ Weight (in kg) - Below 50 ] [ Weight (in kg) – 50 and above ]
[ Dosage (in mg) ]
[30 and below] [ 5 ] [ 10 ]
[Above 30 and below 51][ 10 ] [ 15 ]
[51 and above ][ 15 ] [ 20 ]
how do i do this programing?
and
”Guess the character” is a game that matches the user-entered character with a computer-generated character. If the two characters matches, the game ends. The user is given 10 attempts to guess the computer-generated character. The computer-generated character is generated using a random number generator to generate a number between 0 and 25. This number is used to provide the index of an array of characters from ‘a’ to ‘z’. The program is expected to guide the user in the guessing process.
how do i do this also?
Im totally new to programing and i need help.
please help me. and i really dont understand what is going on in this question.
Try working the steps to the solutions out on paper first in plain language (not programming code). That can help to figure out what information needs to be stored in variables and how the decision tree of the selection statement will be structured.
e.g.
Ask user for age
Ask user for weight
If age is 30 or less and weight is below 50kg, then dosage is....