Using Prompt and Output in Javascript

I have quite the assignment that was assigned for class work and can not figure out how to handle all of these requests at once. Any and all help is appreciated. Here is the prompt followed by some ideas I have that may or may not solve this…

"In a web page called Payroll.html, use separate prompt() statements for the following input:

  • Job title (“W” for wait staff, “H” for host, “K” for kitchen staff)
  • Number of hours worked
  • Number of years employed at the restaurant

Then, output their gross pay amount (i.e., the amount they earn before taxes and other deductions) based on the following:

  • Wait staff earns $5/hour until they’ve worked 1 year, then earn $6/hour
  • Hosts earn $12/hour for the first 2 years, then go up to $13.50/hour
  • Kitchen staff make $15/hour for the first year, then go to $18/hour

Note: At this stage, you do not need to worry about “rounding off” the numbers to look like currency. It’s okay if they have an incorrect number of decimal places.“”

1 Like

Hi! Can you please give us what you’ve already coded?

1 Like

Certainly! Here is what I have so far. Maybe we can go back in the code editor together? You were so helpful with the other prompt that I had…

<body>
	<script>
		var jobTitle ("What is your job title?");
		var hoursWorked ("How many hours have you worked?");
		var yearsWorked ("How many years have you worked here for?");
		
		if waiter {

		if years < 1, wage = $5.
		else if years >= 1, wage = $6

		}
		else if host{

		if years < 2, wage = $12.
		else if years >= 2, wage = $13.50

		}
		else if kitchen{

		if years < 1, wage = $15.
		else if years >= 1, wage = $18

		}

		output wage x hours
	
	
	
	</script>
</body>

This is what I have so far. Cheers

1 Like

I’m working on this assignment right now too! Mine is almost identical hehe. Anyways, you’re more than welcome to come work on it with me inside my glitch.com account.

1 Like

we are actually in the same class lol I took your suggestion that you made about this website and could not be happier with the people I have met so far. How are you doing with this assignment? I am on part two now and can not seem to get it correct…

1 Like

I can not seem to join your link

1 Like

I’m still correcting some mistakes, but here’s the project URL:

1 Like

Just finished the project!
:point_right: Check the code: Glitch :・゚✧

1 Like

Sorry I had to rush with a full studyguide for economics. I keep running out of time for everything.

1 Like