Question: Write a static method called problem 1 that keeps prompting the user for integer values. Calculate the sum of ONLY two - digit numbers. Return

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. Page |1 sid: the cars sid, String, created based on serialNumber, e.g., the first car objects sid should be 1, the second car objects sid should be 2. idNumber: the cars identification numbers, String, each car is assigned with an automatically generated a unique identifier following the rules below: a. Get the first five letters of the cars make. If the name is less than the required number of letters in length, then use the entire name. b. Get the first three letters of the cars model. If the name is less than the required number of letters in length, then use the entire name. c. Get the cars model year. d. Get the cars sid. e. Join them together and make all letters lowercase to create the identifier. 2) Write the constructor. (5 pts)3) Write a public get method for each instance variable. (10 pts) Test cases: Create two car objects, car1, with make Toyota, model Crolla, year 2024// sid is 1 and idNumber is toyotcro20241 car2, with make Ford, model Ranger, year 2019// sid is 2 and idNumber is fordran201926. Write the main method to run each method with the provided test case. (15 pts)

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!