The document contains 3 Java programs:
1) A program that calculates the area of a rectangle by getting length and width values from the user and multiplying them.
2) A program that determines if an integer entered by the user is positive or negative.
3) A program that calculates the average of 4 grading periods entered by the user, and displays if the average is a pass or fail based on being above or below 75.
The document contains 3 Java programs:
1) A program that calculates the area of a rectangle by getting length and width values from the user and multiplying them.
2) A program that determines if an integer entered by the user is positive or negative.
3) A program that calculates the average of 4 grading periods entered by the user, and displays if the average is a pass or fail based on being above or below 75.
The document contains 3 Java programs:
1) A program that calculates the area of a rectangle by getting length and width values from the user and multiplying them.
2) A program that determines if an integer entered by the user is positive or negative.
3) A program that calculates the average of 4 grading periods entered by the user, and displays if the average is a pass or fail based on being above or below 75.
- Write a Java Program that would compute for the area of rectangle.
package appdevfinals;
import java.util.Scanner;
public class AppDevFINALS {
public static void main(String[] args) {
Scanner qwe = new Scanner(System.in);
System.out.print("Enter the LENGTH of rectangle: ");
float l = qwe.nextFloat();
System.out.print("Enter the WIDTH of rectangle: ");
float w = qwe.nextFloat();
float a = l*w;
System.out.println("The AREA of rectangle is " + a);
} } - Create a Java Program that would determine an integer if it is POSITIVE or NEGATIVE.
package appdevfinals;
import java.util.Scanner;
public class AppDevFINALS {
public static void main(String[] args) {
Scanner qwe = new Scanner(System.in);
System.out.print("Enter any integer: ");
int num = qwe.nextInt();
if (num >= 0){
System.out.println("Number " + num + " is a POSITIVE number! "); } else { System.out.println("Number " + num + " is a NEGATIVE number! "); } } } - Make a Java Program that would compute for the average of four grading periods. If the average is equal or greater than 75 display PASSED else FAILED.
package appdevfinals;
import java.util.Scanner;
public class AppDevFINALS {
public static void main(String[] args) {
Scanner qwe = new Scanner(System.in);
System.out.println("Enter your grades from First to Fourth Grading!");
System.out.print("First Grading: "); float first = qwe.nextFloat(); System.out.print("Second Grading: "); float second = qwe.nextFloat(); System.out.print("Third Grading: "); float third = qwe.nextFloat(); System.out.print("Fourth Grading: "); float fourth = qwe.nextFloat();