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]
2 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]2 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
Innovation made from establishment of abucas to the present 5th
Minchanka [31]

Answer:

Douglas-fir, spruce, true fir, beech, and maple are toward the top of the list for oxygen release.Douglas-fir, spruce, true ...

4 0
3 years ago
sara has just started using the Internet. She would like to be more efficient . In 3-4, give sara some advice about how to be mo
natta225 [31]

Hello,

Well my advice for Sara when using the web would be 3 things.

1: Never tell anyone where you live,Your name, Or any other personal information.

This is important as it will keep you safe and others that are in your family.

2: Get anti virus hardware on your devise.

This will help to stop bad people, and bugs/glitches,this will also protect you from information thieves.

3: Make sure to keep your passwords saved on paper.

I know a lot of people use, google(ect.) to save there passwords to make everything easy, but a good way to never loss them is to wright them down.

Have a great day!



7 0
3 years ago
Import java.awt.GridLayout;
Vikki [24]

Answer:

public class ConversionCalculator extends JFrame {

  private JLabel inch_Label, meter_Label, cm_Label, yard_Label;

  private JButton clear, calculate, exit;

  private JTextField inch_tf, cm_tf, meters_tf, yards_tf;

 

  public ConversionCalculator()

  {

     

      exitButtonHandler exitB;

      clearButtonHandler clearB;

      calcButtonHandler calcB;

     

      setTitle("Conversion Calculator");

      setSize(600,200);

      setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

     

      //The first layout we use will be 1 row with three columns

      setLayout(new GridLayout(1,3));

     

      //initialize all the components

      inch_Label = new JLabel("Inches");

      meter_Label = new JLabel("Meters");

      cm_Label = new JLabel("Centimeters");

      yard_Label = new JLabel("Yards");

      clear = new JButton("Clear");

      calculate = new JButton("Calculate");

      exit = new JButton("Exit");

      inch_tf = new JTextField("0.00");

      cm_tf = new JTextField("0.00");

      meters_tf = new JTextField("0.00");

      yards_tf = new JTextField("0.00");

 

      JPanel panel1 = new JPanel();

      panel1.setLayout(new GridLayout(2,2));

      JPanel panel2 = new JPanel();

      panel2.setLayout(new GridLayout(2,2));

      JPanel panel3 = new JPanel();

      panel3.setLayout(new GridLayout(3,1));

      panel1.add(cm_Label);

      panel1.add(cm_tf);

      panel1.add(meter_Label);

      panel1.add(meters_tf);

     

      panel2.add(inch_Label);

      panel2.add(inch_tf);

      panel2.add(yard_Label);

      panel2.add(yards_tf);

     

      panel3.add(clear);

      panel3.add(calculate);

      panel3.add(exit);

     

      add(panel1);

      add(panel2);

      add(panel3);

     

     

      exitB = new exitButtonHandler();

      exit.addActionListener(exitB);

     

      clearB = new clearButtonHandler();

      clear.addActionListener(clearB);

     

      calcB = new calcButtonHandler();

      calculate.addActionListener(calcB);

     

      setVisible(true);

  }

 

  //public static void main(String[] args)

     // {

       // new ConversionCalculator();

      //}

 

  private class exitButtonHandler implements ActionListener

  {

      public void actionPerformed(ActionEvent e)

      {

          //exits program

          System.exit(0);

      }

  }

 

  private class clearButtonHandler implements ActionListener

  {

      public void actionPerformed(ActionEvent e)

      {

          //clear button sets all text fields to 0

          inch_tf.setText("0.00");

          meters_tf.setText("0.00");

          yards_tf.setText("0.00");

          cm_tf.setText("0.00");

      }

  }

 

  private class calcButtonHandler implements ActionListener

  {

      public void actionPerformed(ActionEvent e)

      {

          double inches, yards, meters, cms;

          DecimalFormat df = new DecimalFormat("0.00");

         

          //parse strings in textbox into doubles

          inches = Double.parseDouble(inch_tf.getText());

          yards = Double.parseDouble(yards_tf.getText());

          meters = Double.parseDouble(meters_tf.getText());

          cms = Double.parseDouble(cm_tf.getText());

         

          //we check which value has been tampered with and base our conversion off this

          //because of this it is important that the user clears, or else it will do inch conversion

          if(inches != 0.00)

          {

              cms = inches * 2.54;

              meters = cms / 100;

              yards = inches / 36;

             

              cm_tf.setText(df.format(cms));

              meters_tf.setText(df.format(meters));

              yards_tf.setText(df.format(yards));

             

          }

          else if(yards != 0.00)

          {

              inches = yards / 36;

              cms = inches * 2.54;

              meters = cms / 100;

             

              cm_tf.setText(df.format(cms));

              meters_tf.setText(df.format(meters));

              inch_tf.setText(df.format(inches));

          }

          else if(meters != 0.00)

          {

              cms = meters * 100;

              inches = cms / 2.54;

              yards = inches / 36;

             

              cm_tf.setText(df.format(cms));

              inch_tf.setText(df.format(inches));

              yards_tf.setText(df.format(yards));

          }

          else if(cms != 0.00)

          {

              inches = cms / 2.54;

              yards = inches / 36;

              meters = cms / 100;

             

              meters_tf.setText(df.format(meters));

              inch_tf.setText(df.format(inches));

              yards_tf.setText(df.format(yards));

          }

      }

  }

}

Explanation:

  • Inside the action performed method, pass the strings in text box.
  • check if the value has been modified then do the relevant conversions inside the conditional statement.
  • When the user clears, it will not do to the inch conversion.
8 0
2 years ago
NumA=2<br> for count range (5,8)<br> numA=numA+count <br> print(numA)
love history [14]

Answer:

for count in range (5,8): numA=numA+count print(numA)

Explanation:

7 0
2 years ago
What was the job of the Committee of Correspondence? WILL GIVE BRANLEST AND 40 POINT
Wewaii [24]

Answer:

how many of these information have you shared

5 0
2 years ago
Other questions:
  • What is a bus master?
    14·1 answer
  • Wich of these is an example of magnetic storage
    11·1 answer
  • To copy noncontiguous slides, open Slide Sorter view, click the first slide thumbnail, press and hold ____, click each additiona
    15·1 answer
  • How do you interpret field in contest of a DBMS?
    5·1 answer
  • Which type of drawer has three dispensing modes: single-dose, multi-dose, and matrix?
    13·1 answer
  • What error occurs when you perform an illegal math operation such as divide by zero
    13·1 answer
  • Write a program that allows two players to play a game of tic-tac-toe. Use a two dimensional char array with three rows and thre
    7·1 answer
  • Which of the following is NOT a useful strategy when making an informed purchase ?
    7·1 answer
  • Write a program that uses a dictionary to store students birthdays. Your program should ask the user what their name is, and loo
    11·1 answer
  • Primary functions of lighting are sufficient light to...
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!