Question
Write a function that accepts the length and width of a rectangle and returns the area of the rectangle. Read the dimensions of the rectangle
Write a function that accepts the length and width of a rectangle and returns the area of the rectangle. Read the dimensions of the rectangle from the user in the "main" function.
Write a program that prompts the user "How many random numbers do you want to print?" and prints the random numbers in a rectangle with 10 numbers per row. Also read the range (maximum value) from the user.
Write a program that has two functions-
1. A neighborhood bakery sells bagels at $0.75 each. But if the customer buys 6 or more the price each is $0.60. Write a function that accepts a number for bagels purchased from a bakery and returns the cost of the bagel order.
2.Write a function that accepts a worker's hourly wage and hours and returns the total pay for the week. (Time and a half)
Write a program that has two functions-
a) Write a function that takes temperature in degree celsius as input and converts it to temperature in fahrenheit and returns the result.
temp_f = (9/5) * temp_c +32
b)Write a function that takes as input- a person's height in feet and inches and his weight in pounds to calculate his Body Mass Index.
1 feet = 12 inches
BMI = (weight / (height^2) )* 703 where weight is in pounds and height is in inches
Q5)Write a program that calculates the day of the year given the month, day and year as inputs.
The program must use three functions:
1. days - Returns the number of days in a month
2. leap - Returns 1 if the year is a leap year, 0 otherwise
3. check_bounds - Returns 1 if the value is out of range
A year is a leap year if one of the below conditionss satisfy-
A)year is divisible by 400
B) year is not divisible by 100 but divisible by 4
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started