Question: Create a class named Yourlastname _ Yourfirstname _ midterm ( 1 0 pts ) . In this class, import java.util.Scanner; 1 . Write a static

Create a class named Yourlastname_Yourfirstname_midterm (10 pts). In this class, import java.util.Scanner; 1. Write a static method called problem1 that keeps prompting the user for integer values. Calculate the sum of ONLY two-digit numbers. Return the sum when the user enters 0.(10 pts) Test case: if the input stream is 1,20,300,40,5,600, and 0, problem1() returns 60(20+40=60).2. Write a static method named problem2 that accepts a positive integer as the argument and returns the sum of all the positive even numbers that are less than or equal to the input number. You must use a while loop to solve the problem. (10 pts) Test case: problem2(15) returns 56(because 2+4+6+8+10+12+14=56).3. Write a static method named problem3 that receives a positive integer n as the argument and calculates the sum below by using a loop. Return the result. total =1 x 2+2 x 3+...+ n x (n +1)(10 pts) Test case: problem3(5) returns 70(because 1 x 2+2 x 3+3 x 4+4 x 5+5 x 6=70).4. Write a static method called problem4 that accepts a string as the argument. Assume that this string contains a sequence of words separated by spaces. Each word is surrounded by one # sign at the beginning and at the end. Remove the # signs from the string and then replace it with angle brackets. Make each letter lowercase. Return the result. (10 pts) Test case: problem4(#HELLO# #world# #Python# #BREAK#) returns .5. Write an inner public class named Car (not static). The Car class should have a static variable, serialNumber, and five protected instance variables. 1) Write the following variables: (20 pts) Static variable, serialNumber: the number of the car objects that have been created, static, int, initial value =0. Instance variables make: the brand or company that manufactures the car, String, must be specified when instantiated. model: the version of the car within a manufacturer's lineup, String, must be specified when instantiated. year: the cars model year, int, must be specified when instantiated.

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 Programming Questions!