Cicily is organizing a typing competition. Each participant who clears the competition receives a certificate and a cash prize. The initial mark is ten. For each mistake made, one mark is reduced. If the participant's score is an absolute value, he/she will be rewarded. Can you help Cicily to write a program where she enters the id of a participant and the score obtained, and the program should print the result for that candidate.
Answers
Answered by
0
Following are the program to this question:
output:
Enter your id: 5
Enter your score: 333
Id number 5 is eligible for certificate and prize.
Explanation:
#include <iostream>//defining header file
using namespace std;
int main() //defining main method
{
int id, score; //defining integer variable
cout<<"Enter your id: "; // message
cin>> id; // input id value
cout<<"Enter your score: ";//message
cin>> score;//input score value
if(id<=0) //check id value
{
cout<<"please enter valid value."; //print message
}
else
{
cout<<"Id number "<<id<<" is eligible for certificate and prize."; //print message
}
return 0;
}
Description of the program:
- In this program inside the main method, two integer variable "id and score" are declared, in which by the using of input method we input the values from the user side.
- In the next line a conditional statement is used, that check id value in its block if the value is less then equal to 0 it will print valid input message otherwise, it will go to else block.
- In this block, it will prints id value with the message.
Learn more:
- Input process: https://brainly.in/question/12212173
Similar questions