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
If i wanted to change my phones simcard, does anything need transferring, or is it an easy swap?
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
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.
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.
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
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?
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
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
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