Computer Applications
Write a program to find and display the percentage difference, when a number is updated from 7.5 to 7.2
Answer
public class KboatPercentIncrease
{
public static void main(String args[]) {
double orgNum = 7.5;
double newNum = 7.2;
double inc = newNum - orgNum;
double p = inc / orgNum * 100;
System.out.println("Percentage Difference = " + p + "%");
}
}
Variable Description Table
Program Explanation
Output
Related Questions
The angles of a quadrilateral are in the ratio 3:4:5:6. Write a program to find and display all of its angles. [Hint: The sum of angles of a quadrilateral = 360°]
The normal temperature of human body is 98.6°F. Write a program to convert the temperature into degree Celsius and display the output.
Hint: c / 5 = f - 32 / 9
In a competitive examination, there were 150 questions. One candidate got 80% correct and the other candidate 72% correct. Write a program to calculate and display the correct answers each candidate got.
Write a program to find and display the percentage difference, when a number is updated from 80 to 90