1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
hichkok12 [17]
3 years ago
5

write a program using if condition and print fail and try again if student marks are less than 33 using if condition and print f

ail and try again if student marks are less than 33
Computers and Technology
1 answer:
Aliun [14]3 years ago
6 0

Answer:

Following are the program to this question:

#include <iostream>//defining a herader file

using namespace std;

int main()//defining main method

{

   int marks, i=35;//defining integer variables

   cout<<"enter your marks in a percent: ";//print message

   cin>>marks;//input marks value

   if(marks<i)//defining if block that checks marks less then i

   {

       cout<<"fail and try again";//print message

   }

   else//defining else block

   {

       cout<<"You are qualified";//print message

   }

   return 0;

}

Output:

enter your marks in a percent: 33

fail and try again

Explanation:

In the above-given, C++ language code inside the main method "marks and i" two integer variable is declared, in which the "i" variable holds a value.

In the next step, if block is defined, that checks "marks" value is less than "i", if the value is true, it will print "fail and try again".

Otherwise, it will go to the else block, in this, it will print "You are qualified".

You might be interested in
CODEHS- Please help!
Ksivusya [100]

Answer:

Revisiting "Build a Tower"

Recall in the last section how we made Karel make a tower of tennis balls. We told Karel to move() and turnLeft() and putBall() until we had a tower. At the end of the program, Karel was still at the top of the tower, like as in the picture below.

Stuck at top

Suppose that now we want Karel to come back down from the top of the tower. The first thing we need to do is get Karel facing in the right direction. One way to do this is to tell Karel

turnLeft();

turnLeft();

turnLeft();

And then tell Karel to

move();

move();

move();

back to the bottom of the tower.

However, telling Karel to turnLeft() three times is not very readable. That's a lot of writing when all we really want is to tell Karel to "turn right."

Explanation:

Hopefully it would help.

8 0
2 years ago
Complete the statement below with the correct term.
Lilit [14]

Answer:

<em>Every </em><em>couple</em><em> </em><em>of </em><em>month </em><em>or </em><em>whatever </em><em>you </em><em>give </em><em>it </em><em>to </em><em>someone</em><em> </em><em>else</em>

8 0
2 years ago
What is a disadvantage of shopping online?A.Harder to compare prices than in storesB.A higher risk of financial data theftC.More
babymother [125]

.A higher risk of financial data theftC

7 0
2 years ago
Read 2 more answers
Where is the risk of someone intercepting another person’s online activity the greatest?
sergey [27]

social networking site

3 0
3 years ago
In this lab, you complete a C++ program that swaps values stored in three int variables and determines maximum and minimum value
Sergio039 [100]

Answer:

Following are the code to the given question:

#include <iostream>//header file

using namespace std;

int main()//main method

{

int first = 0,second = 0,third = 0;//defining integer variable  

int temp; //defining integer variable

const string SENTINEL = "done"; // defining a string variable as constant  

string repeat;// defining a string variable  

bool notDone = true; //defining bool variable

cout << "Enter first number: ";//print message

cin >> first;//input value

cout << "Enter second number: ";//print message

cin >> second;//input value

cout << "Enter third number: ";//print message

cin >> third;//input value

while(notDone == true)//defining a loop to check the value  

{

if(first > second)//use if to compare first and second value

{

int temp = first;//defining temp to hold first value

first = second;//holding second value in first variable

second = temp;//holding temp value in second variable

}

if(second > third)//use if to compare second and third value

{

int temp = second;//defining temp to hold second value

second = third;//holding second value in third variable

third = temp;//holding temp value in third variable

}

cout << "Smallest: " << first << endl;//print smallest value

cout << "Next smallest: " << second << endl;//print Next smallest value

cout << "Largest: " << third << endl;////print Largest value

cout << "Enter any letter to continue or done to quit: ";//print message

cin >> repeat;//holding string value

if (repeat == SENTINEL)

{

notDone = false;//holding bool value

}  

else //else block

{

cout << "Enter first number: ";//print message

cin >> first;//input value

cout << "Enter second number: ";//print message

cin >> second;//input value

cout << "Enter third number: ";//print message

cin >> third;//input value

}

return 0;

}

}

Output:

Please find the attached file.

Explanation:

  • Inside the main method Four integer variable "first, second, third, and temp" is declared in which first three variable is used for input value and temp is used to compare value.
  • In thew next step, two string variable "SENTINEL and repeat" is declared in which "SENTINEL" is constant and a bool variable "notDone" is declared.
  • After input the value from the user-end a loop is declared that compare and swap value and print its value.

6 0
2 years ago
Other questions:
  • PLEASE HELP ASAP!!!!
    14·1 answer
  • HELP PLEASE!!! I do online school, someone is in another state wanting to help me. No not do my work for me but view what I view
    6·1 answer
  • Which is NOT a benefit of using visual aids?
    9·2 answers
  • The first step to accurate coding is to identify the ___________ in the diagnostic statement.
    7·1 answer
  • Differentiate between trusted-source-security and antispoofing-security techniques.
    10·1 answer
  • Select the correct answer from each drop-down menu.
    8·1 answer
  • Karl comes across confidential information. What should he do with it? A. Manipulate the information in his favor B. Sell the in
    12·1 answer
  • If a file you are opening for appending does not exist, the operating system will detect the missing file and terminate the oper
    14·1 answer
  • Who do you guys ship lol bit with?
    14·2 answers
  • A. Get a value for x from the user.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!