Question: **Please write the code in java. NO online programs** Program 1: Mass and Weight Scientists measure an object's mass in kilograms and its weight in

**Please write the code in java. NO online programs**

**Please write the code in java. NO online programs** Program 1: Mass

Program 1: Mass and Weight Scientists measure an object's mass in kilograms and its weight in Newtons. If you know the amount of mass that an object has, you can calculate its weight, in Newtons, with the following formula: Weight=Massx9.8 Write a program that asks the user to enter an object's mass, and then calculate its weight. If the object weighs more than 1,000 Newtons, display a message indicating that it is too heavy. If the object weighs less than 10 Newtons, display a message indicating that the object is too light. Program 2: Fat Gram Calculator Write a program that asks the user to enter the number of calories and fat grams in a food item. The program should display the percentage of the calories that come from fat. One gram of fat has 9 calories; therefore: Calories from fat=Fat grams* 9 The percentage of calories from fat can be calculated as follows: Calories from fat+Total calories If the calories from fat are less than 30 percent of the total calories of the food, it should also display a message indicating the food is low in fat. NOTE: The number of calories from fat cannot be greater than the total number of calories in the food item. If the program determines that the number of calories from fat is greater than the number of calories in the food item, it should display an error message indicating that the input is invalid

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!