Write the following mathematical expressions in Java.
Want to see the full answer?
Check out a sample textbook solutionChapter 2 Solutions
Big Java Late Objects
Additional Engineering Textbook Solutions
Starting Out with C++: Early Objects (9th Edition)
Database Concepts (7th Edition)
Java How to Program, Early Objects (11th Edition) (Deitel: How to Program)
Experiencing MIS
Problem Solving with C++ (9th Edition)
- Calculate your Physics final Write a Java program to solve the following problem: grade based on the following: Assessment Percent Lab Activity(ies) Quiz (zes)/Test (s) 10% 10 Assignment (s) 208 Midterm Exam (8) 20% Final Exam 40% Theory grade is the quiz/test, midterm and final exam marks. Practical grade is the assignment and lab marks. Final grade is all five marks. But the calculation of Final grade needs to comply with the following rule: If either of the practical or theory grade is less than 50%, the final grade is the lesser of the two. A grade letter must be assigned based on the final grade (See the courses outline for the distribution of grades) You must implement input validation for each mark as follows: Lab mark must be out of 10. Quiz/Test mark must be out of 10. Assignment mark must be out of 20. Midterm mark must be out of 20. Final Exam must be out of 40. Bonus: Modify your code so that you can calculate and display grade for N number of students. Your program must…arrow_forwardIn JAVA ASSIGNMENT DESCRIPTION: A half-life is the amount of time it takes for a substance or entity to fall to half its original value. Caffeine has a half-life of about 6 hours in humans. Given caffeine amount (in mg) as input, output the caffeine level after 6, 12, and 24 hours. Output each floating-point value with two digits after the decimal point, which can be achieved as follows:System.out.printf("After 6 hours: %.2f mg\n", yourValue); Ex: If the input is: 100 the output is: After 6 hours: 50.00 mg After 12 hours: 25.00 mg After 24 hours: 6.25 mg Note: A cup of coffee has about 100 mg. A soda has about 40 mg. An "energy" drink (a misnomer) has between 100 mg and 200 mg. THE CODE I HAVE SO FAR: import java.util.Scanner; public class LabProgram { public static void main(String[] args) { Scanner scnr = new Scanner(System.in); double caffeineMg; // "double" supports floating-point like 75.5, versus int for integers like 75. caffeineMg = scnr.nextDouble(); System.out.printf("After…arrow_forwardSubject: Java Programmingarrow_forward
- Please code it in Javaarrow_forwardIn Java Write a program that generates two integers and prompts the user to enter the sum of these two integers. Revise the program to generate three single digit integers and prompt the user to enter the sum of these three integersarrow_forwardUnderstanding if Statements Summary In this lab, you complete a prewritten Java program for a carpenter who creates personalized house signs. The program is supposed to compute the price of any sign a customer orders, based on the following facts: The charge for all signs is a minimum of $35.00. The first five letters or numbers are included in the minimum charge; there is a $4 charge for each additional character. If the sign is made of oak, add $20.00. No charge is added for pine. Black or white characters are included in the minimum charge; there is an additional $15 charge for gold-leaf lettering. Instructions 1. Ensure the file named HouseSign.java is open. 2. You need to declare variables for the following, and initialize them where specified: A variable for the cost of the sign initialized to 0.00 (charge). A variable for the number of characters initialized to 8 (numChars). A variable for the color of the characters initialized to "gold" (color). A variable for the…arrow_forward
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTEBK JAVA PROGRAMMINGComputer ScienceISBN:9781305480537Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT