Program c++ for selection (1)

Here is an example of C + + program that uses the IF statement. The problem is as follows: By using the IF statement, create a program to determine whether a student is "Passed" or "No Pass" on the basis of Value Theory and Practice Value entered by the user.

     Terms of students would graduate if the average value of at least 60 and minimum value of Practice 55. Eg = 100 Value Theory, Practice Value = 50 then the result = Disqualified. For example, Value Theory = 40, Value Practice = 90 then the result is Passed . Seeing the above question, then we know that there are two inputs namely Value Theory and Practice Value. Students will be based on two things: the average value and value theory. So first we must find the average value of first is by adding up the value of theory and practice and then divided by two. Program C + + more to answer the questions above are as follows:
 

# include <stdio.h>
# include <conio.h>
#include <iostream.h>

void main ()
{
clrscr ();
float the theory, practice, rata2;
court <<"Enter the value of theory:";
cin>> theory;
court <<"Enter the value of practice:", cin>> practice;

rata2 = (theory + practice) / 2;
if (rata2> = 60 & & practices> = 55)
{court <<"Passed";}
else
{court <<"No Pass";}
getch ();
}

0 comments



Recent Entries