Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Task #1 Who is the best! Create a program that will perform the following. It will ask the user for the first players score and

Task #1 Who is the best! Create a program that will perform the following. It will ask the user for the first players score and then ask for the second players score. It will then use this information to display what player had the highest score and what the difference between the two scores were. You code must include the following: Build a function named scoreDifference() that will take two parameters player1s score and player2s score. The function will then use the min and/or max function be sure that it is subtracting the higher value from the lower value. The difference will then be returned. Task #2 Wanna play a game? We want to create a short program that performs the following task. A user is asked if they would like to play a game. If they answer y, yes, Yes or any other variation of the word (starting with a Y) we will print to the screen Hooray! So glad to be playing a game with you!. If they answer n, no, No or any other variation of the word No (starting with an N), then we will display to the screen Sorry that you dont want to play with me :( . If they enter any other value, we display Sorry didnt get that please enter your choice again and they will be prompted to run the program once more. Your code must include the following: toLowerCase function, a loop and the substr function Task #3 Create a math program that will ask the user to enter in any two numbers. The numbers will then be added, subtracted, multiplied and divided. The result of each will be displayed to the screen. Note each of the mathematical operations must be completed using a function that you create. The function must NOT make use of global variables. The functions must return a value. You must ensure that the higher number is always subtracted from and divided from. Format all results to two decimal places. Standard comments are included in your file. Submit an electronic version using the submission point located in the week 8 folder. The electronic version MUST be in html format. Any other format will NOT be accepted and you will receive a zero mark for your assignment. The assignments MUST be submitted by the START of the first lab of week #9. Once the due date and time has passed the submission is considered late a mark of zero (0) will be assigned. Keep it simple do not do more than what was asked You may only use what we have learned in class to this point.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Time Series Databases New Ways To Store And Access Data

Authors: Ted Dunning, Ellen Friedman

1st Edition

1491914726, 978-1491914724

More Books

Students also viewed these Databases questions

Question

Why is it important to ask ones own questions of the interviewer?

Answered: 1 week ago

Question

How do modern Dashboards differ from earlier implementations?

Answered: 1 week ago