Question: 1) Create a method called whatTypeOfPedalCycle() The method should take an int. The method should return a String based on the int that was provided.

1)

Create a method called whatTypeOfPedalCycle() The method should take an int. The method should return a String based on the int that was provided. If the int is 1, return unicycle, if the int is 2 return bicycle, and if the int is 3 return tricycle. If the int is anything else, return error. Solve this problem using any conditional structure of your choice. Use the method in your main method at least 5 times: proving that 0 is error, 1 is unicycle, 2 is bicycle, 3 is tricycle, and 4 is error. Remember that the sysouts should be in the main method, not in whatTypeOfPedalCycle()! 2) Implement a method isPass(int grade). The method takes an int and returns a boolean. If the int is greater than or equal to 70, return true. If not, return false. Use 1 ternary operation for this method. Use the isPass() method in your main method at least twice to demonstrate one true and one false example. 3) Implement a method printPay(double wage, int hours). It takes a wage in the form of a double (like 17.50) and hours worked as int. Use printf to output the wage, hours paid, and total pay in the following format: $17.50 x 5 = $87.50 The dollar signs are strings, the x is a string, and the = is a string. The 17.50 is the double wage to 2 decimal spaces (%.2f), the 5 is the hours as an integer (%d), and the 87.50 is hours * wage, also as a double (%.2f). Remember that this is a method. It takes variables. None of those numbers are fixed. The only fixed parts are the strings mentioned. Everything else is variable. Use it in your main method at least once.

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