Java Question( If else )

timer Asked: Feb 17th, 2015

Question Description

I’m studying and need help with a Programming question to help me learn.


Unformatted Attachment Preview

In Java, you can use a pre-defined Math method to generate a random number. For example, the following codes generate a random number between 0 and 9 and a double number between 0 and 100: int num = (int) (Math.random()*10); double numDouble = Math.random()*100; Use the random generated numbers into your programs later if required. 1. Write one program that computes the final grade based on 5 parts: Lab 30%, Mid-term 20%, Final exam 25%, Quiz 20% and Attendance 5%. Print out the final letter grade. You can random generate the grade for each part. Example: finalG = (Lab *0.3 + MidTerm*0.2+… Attendance*0.05); finalG >= 93 A 93 >finalG >= 93 B … 2. Random generate a number and check whether it is divisible by 5 and 6, whether it is divisible by 5 or 6 and whether it is divisible by 5 or 6 but not both. 3. Write a class named season that has two integer variables representing a month and day. Assume that months are specified as an integer between 1 and 12 (1 for January, 2 for February, and so on) and that the day of the month is a number between 1 and 31. If the date falls between 12/16 and 3/15, you should print "Winter". If the date falls between 3/16 and 6/15, you should print "Spring". If the date falls between 6/16 and 9/15, you should print "Summer". And if the date falls between 9/16 and 12/15, you should print "Fall". ...
Student has agreed that all tutoring, explanations, and answers provided by the tutor will be used to help in the learning process and in accordance with Studypool's honor code & terms of service.

This question has not been answered.

Create a free account to get help with this and any other question!

Brown University

1271 Tutors

California Institute of Technology

2131 Tutors

Carnegie Mellon University

982 Tutors

Columbia University

1256 Tutors

Dartmouth University

2113 Tutors

Emory University

2279 Tutors

Harvard University

599 Tutors

Massachusetts Institute of Technology

2319 Tutors

New York University

1645 Tutors

Notre Dam University

1911 Tutors

Oklahoma University

2122 Tutors

Pennsylvania State University

932 Tutors

Princeton University

1211 Tutors

Stanford University

983 Tutors

University of California

1282 Tutors

Oxford University

123 Tutors

Yale University

2325 Tutors