Review problems related to loops

Assignment Help Programming Languages
Reference no: EM132039682

Question: Instructions

1. Using a switch statement:

• If the employee type is P or p, then display "Part- time employee" on the screen

• If the employee type is F or f, then display "Full-time employee" on the screen

• If the employee type is T or t, then display "Temporary employee" on the screen

• If the employee is none of the above, then display "Invalid employee type" on the screen

2. Using an single individual distinct if statement (not a nested if):

• If the employee makes $50 an hour or more, and is also a full-time employee, print out to the screen "You must be a Java programmer!"

3. Using a single if-else-if statement:

• If the employee type is part-time, and the hours worked is 35 hours or more, then print out to the screen "You worked like a Full-time employee"

• If the employee type is full-time, and the hours worked is less than 25, then print out to the screen "Are you sure you're not a part-time employee?"

• Else print out to the screen "Have a nice day!"

4. Using a while loop structure:

• If the total hours worked is less than 0 or greater than 280, then print out "That's not possible, please try again!" to the screen. Prompt the user to enter the total hours again (inside the loop)

• Allow up to 3 total invalid attempts for the user to enter the correct number of hours. After the 3rd attempt, print out "You are Fired!" and exit the program (or start program over)

5. Using a do-while loop structure:

• After the program completes, ask the user "Do you want to start the program over again? (Enter Yes or No)".

• If the user enters "Yes" as a String literal (in any case meaning they can enter Yes, yes, yeS, yEs, YES, or YEs and it should still work), then the program should start over again from the beginning

6. Write very good comments above all of the 5 parts above, and also a block style comment at the very top of your program with your name in it.

Reference no: EM132039682

Questions Cloud

What is her gross debt service ratio : Property taxes on the house are expected to be $1200 per year. What is her gross debt service ratio?
What is the initial cost of the project : The profitability index is 1.59 and the discount rate is 10.4 percent. What is the initial cost of the project?
How long must the firm wait until it recovers : How long must the firm wait until it recovers all of its initial investment?
What is the project operating cash flow : The Stop Shoppe currently sells blue jeans and T-shirts. Management is considering adding fleece tops to its inventory to provide a cooler weather option.
Review problems related to loops : Using a switch statement: If the employee type is P or p, then display "Part- time employee" on the screen. If the employee type is F or f, then display.
Record the purchase of insurance in advance on march : Mountaineer Excavation operates in a low-lying area that is subject to heavy rains and flooding. Record the purchase of insurance in advance on March 1
What is meant by the three-month forward exchange rate : What is the differences between a Eurobond and a foreign bond? What is meant by the three-month forward exchange rate?
Write the goal at least two parent business requirements : Write the goal, at least two "parent" business requirements and two "child" user requirements for each business requirement;
What is the cost of debt and after tax : What is the Cost of Debt and After Tax? What is the Cost of Preferred? What is the Cost of Equity? Calculate payback

Reviews

Write a Review

Programming Languages Questions & Answers

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd