At the State Fair Pie Eating Contest all contestants in the heavyweight
division must weigh within 30 pounds of 250 pounds. Write a program that asks for a
contestant's weight and then says if the contestant is allowed in the contest.
1
Expert's answer
2012-10-25T10:35:17-0400
import java.util.Scanner;
public class Test {
public static void main(String[] args) {
Scanner console = new Scanner(System.in);
System.out.println("Enter your weight in pounds, please: ");
String temp = console.next();
int weight = Integer.parseInt(temp);
if (weight >= 30 && weight <= 250) {
System.out.println("You're allowed in the contest");
} else
System.out.println("You're NOT allowed in the contest");
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
Finding a professional expert in "partial differential equations" in the advanced level is difficult.
You can find this expert in "Assignmentexpert.com" with confidence.
Exceptional experts! I appreciate your help. God bless you!
Comments
Leave a comment