2.3 Write a program to prompt the user for hours and rate per hour using input to compute gross pay. Use 35 hours and a rate of 2.75 per hour to test the program (the pay should be 96.25). You should use input to read a string and float() to convert the string to a number. Do not worry about error checking or bad user data.

Answers

Answer 1

Answer:

The programming language is not stated; However this program will be written using Python programming language

Comments are not used; See Explanation Section for line by line explanation of the code

hours = float(input("Hours: "))

rate = float(input("Rate per hour: "))

pay = hours * rate

print(pay)

Explanation:

The first line of the code prompts the user for hour.

The input is converted from string to float

hours = float(input("Hours: "))

The next line prompts the user for hour.

It also converts input from string to float

rate = float(input("Rate per hour: "))

Pay is calculated by multiplying hours by rate; This is implemented using the next line

pay = hours * rate

The calculated value of pay is displayed using the next line

print(pay)

When the program is tested by the given parameters in the question

hours = 35

rate = 2.75

The printed value of pay is 96.25


Related Questions

If i wanted to change my phones simcard, does anything need transferring, or is it an easy swap?

Answers

Most likely not but I think you’ll have to log in your account like if you have an Apple phone . You’ll have to log into your Apple ID

Give an example of a function from N to N that is: Hint: try using absolute value, floor, or ceiling for part (b). (a) one-to-one but not onto (b) onto but not one-to-one (c) neither one-to-one nor onto

Answers

Answer:

Let f be a function  

a) f(n) = n²  

b) f(n) = n/2  

c) f(n) = 0  

Explanation:  

a) f(n) = n²  

This function is one-to-one function because the square of two different or distinct natural numbers cannot be equal.  

Let a and b are two elements both belong to N i.e. a ∈ N and b ∈ N. Then:

                               f(a) = f(b) ⇒ a² = b² ⇒ a = b  

The function f(n)= n² is not an onto function because not every natural number is a square of a natural number. This means that there is no other natural number that can be squared to result in that natural number.  For example 2 is a natural numbers but not a perfect square and also 24 is a natural number but not a perfect square.  

b) f(n) = n/2  

The above function example is an onto function because every natural number, let’s say n is a natural number that belongs to N, is the image of 2n. For example:

                               f(2n) = [2n/2] = n  

The above function is not one-to-one function because there are certain different natural numbers that have the same value or image. For example:  

When the value of n=1, then

                                  n/2 = [1/2] = [0.5] = 1  

When the value of n=2 then  

                                   n/2 = [2/2] = [1] = 1  

c) f(n) = 0

The above function is neither one-to-one nor onto. In order to depict that a function is not one-to-one there should be two elements in N having same image and the above example is not one to one because every integer has the same image.  The above function example is also not an onto function because every positive integer is not an image of any natural number.

All of the following are true about hacksaws except: a. A hacksaw only cuts on the forward stroke. b. A coarse hacksaw blade (one with fewer teeth) is better for cutting thick steel than a fine blade. c. A fine hacksaw blade (one with many teeth) is better for cutting sheet metal. d. A hacksaw blade is hardened in the center, so it is best to saw only with the center portion of the blade.

Answers

B is INCORRECT good sir. The Hope this helps, brainiest please.

All of the following are true about hacksaws, except a coarse hacksaw blade (one with fewer teeth) is better for cutting thick steel than a fine blade. The correct option is b.

What is a hacksaw?

A hacksaw is a saw with fine teeth that were originally and primarily used to cut metal. Typically, a bow saw is used to cut wood and is the corresponding saw.

Hacksaw is used by hand, it is a small tool for cutting pipes rods wood etc that is very common and homes and in shops. The different types of hacksaws. The main three types of hacksaws are course-grade hacksaws, medium-grade hacksaws, and fine-grade hacks. The difference is just for the quality, and the design of the blade.

Therefore, the correct option is b. Cutting thick steel is easier with a coarse hacksaw blade (one with fewer teeth) than a fine one.

To learn more about hacksaw, refer to the below link:

https://brainly.com/question/15611752

#SPJ2

Complete a prewritten C++ program for a carpenter who creates personalized house signs. The program is supposed to compute the price of any sign a customer orders, based on the following facts:

The charge for all signs is a minimum of $35.00.
The first five letters or numbers are included in the minimum charge; there is a $4 charge for each additional character.
If the sign is made of oak, add $20.00. No charge is added for pine.
Black or white characters are included in the minimum charge; there is an additional $15 charge for gold-leaf lettering.

Instructions:

Ensure the file named HouseSign.cppis open in the code editor. You need to declare variables for the following, and initialize them where specified:

A variable for the cost of the sign initialized to 0.00 (charge).
A variable for the number of characters initialized to 8 (numChars).
A variable for the color of the characters initialized to "gold" (color).
A variable for the wood type initialized to "oak" (woodType).
Write the rest of the program using assignment statements and ifstatements as appropriate. The output statements are written for you.

Answers

Answer:

#include <iostream>

#include <string>

using namespace std;

int main()

{

   double charge = 0.00;

   int numChars = 8;

   string color = "gold";

   string woodType = "oak";

   

   if(numChars > 5){

       charge += (numChars - 5) * 4;

   }

   if(woodType == "oak"){

       charge += 20;

   }

   if(color == "gold"){

       charge += 15;

   }

   charge += 35;

   

   cout << "The charge is: $" << charge << endl;

   return 0;

}

Explanation:

Include the string library

Initialize the variables as specified

Check if the number of characters is greater than 5 or not. If it is, add 4 to the charge for each character that is greater than 5

Check if the sign is made of oak or not. If it is, add 20 to the charge

Check if the color is gold or not. If it is, add 35 to the charge

Add the minimum cost to the charge

Print the charge

In this exercise we have to use the knowledge of the C++ language to write the code, so we have to:

The code is in the attached photo.

So to make it easier the code can be found at:

#include <iostream>

#include <string>

using namespace std;

int main()

{

  double charge = 0.00;

  int numChars = 8;

  string color = "gold";

  string woodType = "oak";

  if(numChars > 5){

      charge += (numChars - 5) * 4;

  }

  if(woodType == "oak"){

      charge += 20;

  }

  if(color == "gold"){

      charge += 15;

  }

  charge += 35;

  cout << "The charge is: $" << charge << endl;

  return 0;

}

See more about C++ at brainly.com/question/26104476

(Convert milliseconds to hours, minutes, and seconds) Write a function that converts milliseconds to hours, minutes, and seconds using the following header: def convertMillis(millis): The function returns a string as hours:minutes:seconds. For example, convertMillis(5500) returns the string 0:0:5, convertMillis(100000) returns the string 0:1:40, and convertMillis(555550000) returns the string 154:19:10. Write a test program that prompts the user to enter a value for milliseconds and displays a string in the format of hours:minutes:seconds. Sample Run Enter time in milliseconds: 555550000 154:19:10

Answers

Answer:

I am writing the Python program. Let me know if you want the program in some other programming language.

def convertMillis(millis):  #function to convert milliseconds to hrs,mins,secs

   remaining = millis  # stores the value of millis to convert

   hrs = 3600000  # milliseconds in hour

   mins = 60000  # milliseconds in a minute

   secs = 1000  #milliseconds in a second

   hours =remaining / hrs  #value of millis input by user divided by 360000

   remaining %= hrs  #mod of remaining by 3600000

   minutes = remaining / mins  # the value of remaining divided by 60000

   remaining %= mins  #mod of remaining by 60000

   seconds = remaining / secs  

#the value left in remaining variable is divided by 1000

   remaining %= secs  #mod of remaining by 1000

   print ("%d:%d:%d" % (hours, minutes, seconds))

#displays hours mins and seconds with colons in between

   

def main():  #main function to get input from user and call convertMillis() to #convert the input to hours minutes and seconds

   millis=input("Enter time in milliseconds ")  #prompts user to enter time

   millis = int(millis)  #converts user input value to integer

   convertMillis(millis)   #calls function to convert input to hrs mins secs

main() #calls main() function

Explanation:

The program is well explained in the comments mentioned with each line of code. The program has two functions convertMillis(millis) which converts an input value in milliseconds to hours, minutes and seconds using the formula given in the program, and main() function that takes input value from user and calls convertMillis(millis) for the conversion of that input. The program along with its output is attached in screenshot.

What feature in the Windows file system allows users to see only files and folders in a File Explorer window or in a list of files from the dir command to which they have been given at least read permission?

Answers

Answer:

Access based enumeration

Explanation:

The access based enumeration is the feature which helps the file system to allow users for seeing the files and folders for which they have read access from the direct command.

Access based enumeration: This feature displays or shows only the folders and files that a user has permissions for.

If a user do not have permissions (Read) for a folder,Windows will then hide the folder from the user's view.

This feature only function when viewing files and folders are in a shared folder. it is not active  when viewing folders and files in a local system.

3.26 LAB: Leap Year A year in the modern Gregorian Calendar consists of 365 days. In reality, the earth takes longer to rotate around the sun. To account for the difference in time, every 4 years, a leap year takes place. A leap year is when a year has 366 days: An extra day, February 29th. The requirements for a given year to be a leap year are: 1) The year must be divisible by 4 2) If the year is a century year (1700, 1800, etc.), the year must be evenly divisible by 400 Some example leap years are 1600, 1712, and 2016. Write a program that takes in a year and determines whether that year is a leap year. Ex: If the input is: 1712 the output is: 1712 - leap year

Answers

Answer:

year = int(input("Enter a year: "))

if (year % 4) == 0:

  if (year % 100) == 0:

      if (year % 400) == 0:

          print(str(year) + " - leap year")

      else:

          print(str(year) +" - not a leap year")

  else:

      print(str(year) + " - leap year")

else:

  print(str(year) + "- not a leap year")

Explanation:

*The code is in Python.

Ask the user to enter a year

Check if the year mod 4 is 0 or not. If it is not 0, then the year is not a leap year. If it is 0 and if the year mod 100 is not 0, then the year is a leap year. If the year mod 100 is 0, also check if the year mod 400 is 0 or not. If it is 0, then the year is a leap year. Otherwise, the year is not a leap year.

Use an Excel function to find: Note: No need to use Excel TABLES to answer these questions! 6. The average viewer rating of all shows watched. 7. Out of all of the shows watched, what is the earliest airing year

Answers

Answer:

Use the average function for viewer ratings

Use the min function for the earliest airing year

Explanation:

The average function gives the minimum value in a set of data

The min function gives the lowest value in a set of data

Other Questions
HELP ME PLEASE REALLY IMPORTANT OR ILL GET IN TROUBLE!! WILL MARK AS BRAINLEST IF YOU GET IT CORRECT!! Each trait of a plant is determined by _____. A) an alleleB) one gene C) a pair of genes D) one dominant gene Please answer this correctly which system of equations has no sulotion? Be sure to answer all parts. Three 8L flasks, fixed with pressure gauges and small valves, each contain 4 g of gas at 276 K. Flask A contains He, flask B contains CH4, and flask C contains H2. Rank the flask contents in terms of: Which detail in this excerpt reveals heroic qualities andsupports the universal theme of loyalty to one's country?Queen Boadicea uses a spear to fight.Queen Boadicea's people are filled with love for her.O Queen Boadicea believes in a vengeful god.O Queen Boadicea's golden hair blows around her in thewind.Please answer need help immediately Read the sentence. I love reading travel books because they include beautiful pictures of faraway places and they motivate me to explore the world. How should this sentence be revised? I love reading travel books, because they include beautiful pictures of faraway places and they motivate me to explore the world. I love reading travel books because they include, beautiful pictures of faraway places and they motivate me to explore the world. I love reading travel books because they include beautiful pictures of faraway places, and they motivate me to explore the world. I love reading travel books because they include beautiful pictures of faraway places and, they motivate me to explore the world. if BPD and dpc have a sumof 72 degrees What is APC?A. 18B 90D.180 How do atmospheric conditions influence weather patterns? Graph g(x)=-2|x-5|-4 Which character is the most anxious to have Helen back at home? (after her week with Annie in the garden house) James, Captain Keller, Annie Sullivan, Percy, Kate What is the area of the trapezoid below? Select one: a. 88 cm2 b. 443 cm2 c. 65 cm2 d. 363 cm2 Esterification is what type of reaction? 1.addition 2.neutralization 3.combustion 4.equilibrium Jaden had 2 7/16 yards of ribbon. He used 1 3/8 yards of ribbon to make a prize ribbon. How much does he have now? Could someone help me match the types of resources with their descriptions ? if a=3i+9j and b=4i-6j, find 5a-3b Write your answer in the form i + j. Write 18-2 square root of -9 in the form of a+bi The "three R's" describe an infant or toddler'sA. angry reactions to other children.B. verbal responses to adults.C. general interactions with others.D. reaction to physical abuse by another child. How much net force is required to keep a 3-kg object moving to the right with a constant speed of6.0 m/s? Select the correct answer. Which question best completes this conversation? (Hotel receptionist Paula is completing Mr. Fernandos registration form.) Paula: Cmo se llama? Sr. Fernando: Me llamo Carlos Fernando. Paula: _____________ Sr. Fernando: La fecha de mi nacimiento es el veinte de abril. A. Cundo es tu fecha de nacimiento? B. Qu es tu fecha de nacimiento? C. Cul es la fecha de su nacimiento? D. Cunto es la fecha de su nacimiento?