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 problem that keeps prompting the user for integer values. Calculate the sum of ONLY twodigit numbers. Return the sum when the user enters pts Test case: if the input stream is and problem returns Write a static method named problem 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. pts Test case: problem returns because Write a static method named problem that receives a positive integer n as the argument and calculates the sum below by using a loop. Return the result. total x x n x n pts Test case: problem returns because x x x x x Write a static method called problem 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. pts Test case: problem#HELLO# #world# #Python# #BREAK# returns Write an inner public class named Car not static The Car class should have a static variable, serialNumber, and five protected instance variables. Write the following variables: pts Static variable, serialNumber: the number of the car objects that have been created, static, int, initial value 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 sid: the cars sid, String, created based on serialNumber, eg the first car objects sid should be the second car objects sid should be 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. Write the constructor. pts Write a public get method for each instance variable. pts Test cases: Create two car objects, car with make Toyota model Crolla year sid is and idNumber is toyotcro car with make Ford model Ranger year sid is and idNumber is fordran Write the main method to run each method with the provided test case. pts
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
