Write a program which accepts days as integer variable and display total number of years, months and days in it. for example: If user input as 856 days the output should be 2 years 4 months 6 days.
Q: Write a program that prompts the user to enter four integersand then displays all possible ways of…
A: Since, here no programming language is specified. So, we are providing the solution in Java. The…
Q: Write a program that reads a four-digit integer, such as 2014, and then displays it, one digit per…
A: Program Approach: Create an empty list. Declare a user input integer variable for taking the…
Q: You can find out how many seconds have elapsed since Jan 1, 1970 using the time() function.…
A:
Q: Write a program that prompts the user to enter an integer for today’s day of the week (Sunday is 0,…
A: NOTE: SINCE THE LANGUAGE OF THE CODE IS NOT MENTIONED, I HAVE USED JAVA FOR THE SOLUTION. Define…
Q: Write a program that determines a student grade's given his/her final score. Use the following table…
A: According to the Question below the Solution: Output:
Q: Write a program to convert centigrade to Kelvin. It should display value in centigrade and then the…
A: Python program to solve the given problem is below.
Q: Python Write a program that receives a number from a user and checks if it's float or integer. In…
A: a=float(a)if int(a)/a==1: if a%2 == 0: print("This is Integer and Even Number") else:…
Q: Write a program that reads the subtotal and the gratuity rate, then computes the gratuity and total.…
A: Here I have asked the user to enter subtotal and gratuity rates. Then I have calculated the gratuity…
Q: Given an a dollar amount Write a program to convert it into Maximum number of bills to give * 100s,…
A: Source Code dollar.cpp #include<bits/stdc++.h> using namespace std; int main(){ int…
Q: Write a program to calculate velocity of a car when distance and time are given by the user.
A: C Programming: C programming is a procedural language that was developed in Bell Laboratories by…
Q: Write a program to read a number representing the time in 24-hours (i.e., 4-digits ). Then find the…
A: Modulo(%) operator: The modulo operator (%) also called a remainder operator which is used to get…
Q: Q2/ Write a program that reads a code and temperature. If the code is 1, convert from centigrade to…
A: C programming: C programming is a procedural programming language that was developed by Dennis…
Q: Write a program to enter a value of x and compute the value of y where x if x ≥0 -x if x < 0 y =
A: #include <stdio.h>int main(){ int x,y; printf("Enter value of x: ");…
Q: Write a program that reads in an investment amount, the annual interest rate, and the number of…
A: PROGRAM CODE: import java.util.Scanner; public class Main { public static void main(String[] args) {…
Q: Write a payroll program that computes an employee's gross pay and net pay. An employee who works…
A: CODE IS: #include<stdio.h> { hours=int(input("Enter number of hours per week:"))…
Q: Write a program that prompts the user to enter an integer between1 and 12 and then displays the name…
A: Program approach: Input an integer between 1 and 12. Displays the name of the month that…
Q: Write a program that prompts the user to input the number of quarters, dimes, and nickels. The…
A: Program: //include the header file #include <iostream> using namespace std; //definition…
Q: Write a program which accepts days as integer variable and display total number of years, months and…
A: Please find the answer below :
Q: Write a program that asks the user to enter a three-digit number, then prints the sum of its digits
A: Code snippet:
Q: Suppose that the rent for an apartment is $1000 this year and increases 3% every year. Write a…
A: Summary: In this question, we have been given one statement and we have to code it. We have given…
Q: write a program to print the name of day when entering the number of the day. (For example, when the…
A: read a value convert it into int using Integer.Parse() if x=1 then display “sunday” else if x=2 then…
Q: Write a program that calculates the number of hours, minutes, and seconds in N seconds. Example: In…
A: The above question is solved in step 2 :-
Q: Write a program that checks to see if the user won the lottery. Assume the winning lottery numbers…
A: Since no programming language is mentioned, I am using python. Algorithm: Start Store the given…
Q: Write a program that takes an integer as an input and returns whether it is a prime number or not.
A: Q. Write a program that takes an integer as an input and returns whether it is a prime number or…
Q: Write a program that converts minutes to days, hours and minutes. The program output should be as…
A: Algorithm: Start Initialise min, d, h, m print input minutes Read the value of minutes d =…
Q: write a program. There are three seating categories at a stadium. For a softball game, Class A…
A: #include <iostream>#include <iomanip>using namespace std; int main(){ int…
Q: Write a program that reads in loan amount, annual interest rate and number of years for the loan and…
A: Actually, program is an executable software that runs on a computer.
Q: Write a program that will ask the user to input three integer values from the keyboard. Then it will…
A: #include <iostream>#include <conio.h>using namespace std;int maxval(int, int,int);int…
Q: Write the program that will ask the user to enter a positive integer, then determine and show the…
A: Program is in C language to show number of digit in that integer :- #include <stdio.h>int…
Q: Write a program that allows the user to input their weight in, height in feet, age in years, and…
A: Body mass index is a person's weight in kilograms divided by the square of height in meters.
Q: You can find out how many seconds have elapsed since Jan 1, 1970 using the time() function. #include…
A: Algorithm Steps:- 1. Find the number of seconds since Jan 1, 1970, using the time(NULL) function…
Q: Write in Python program... for an invoice calculation program, write the python program that…
A: code:
Q: Write a program using else if to input the number of students(stu) and number of teachers(tea) in…
A: C used to answer this question
Q: Write a program that takes in a positive integer as input representing the number of employees, then…
A: We plan to use a Language Understanding container for an application that we previously exported. We…
Q: Write a program which accepts days as integer variable and display total number of years, months and…
A: import java.util.*;public class Main{ public static void main(String[] args) { int…
Q: Write a program that asks the user for a negative number, then prints out the product of all the…
A: Solution: Since any specific language for the above question is not mentioned, we have solved…
Q: Write a program that will convert miles to kilometers and kilometers to miles. The user will…
A: Required: Required code with comments for explanation and screenshot of both code and output has…
Q: Write a program that will display a table of trigonometric functions: sin x, and tan x for x is from…
A: SOURCE CODE: import math#read degreeprint("{:15}".format("Angle"),end=" ")print("{:10}".format("sin…
Q: Write a program that allows the user to specify the number of iterations used in this approximation…
A: # if you want value of pi then you need to multiply by 4 in given equation# because the relation is…
Q: Driving is expensive. Write a program with a car's miles/gallon and gas dollars/gallon (both…
A: #program to find cost for 20,75,500 miles for given miles/galon and gas dollars/gallon#reading…
Q: Write a program that can determine the number of days in a month for a specified month and year. The…
A:
Q: Write a program that shows the numbers up to the entered number that are divisible by 6 but not…
A: Here I have first of all asked the user to enter a number and stored it into a variable num. Now I…
Q: Write a program to enter a value of x and compute the value of y where x if x 20 -x if x<0 y=
A: I have provided C CODE along with CODE SCREENSHOT and 2 OUTPUT…
Q: Write a program that asks the user to enter two integers: n1 and n2 and prints the sum of all…
A: Given: Write a program that asks the user to enter two integers: n1 and n2 and prints the sum of all…
Q: Write a program to convert an integer to binary number. Ask the user to enter an integer and convert…
A: Write a C++ program to convert an integer to a binary number Answer: Given a decimal number as…
Q: Write a program to read any Month Number in integer and display the number of days for this month
A: Use if else ladder to check condition for months. Syntax:- if(condition) statement else…
Q: Write a program that requests the floating number of hours a person works in a given week and the…
A: wagePerHour=float(input("Enter hourly wage: ")); #input wage per…
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 3 images
- Q1. Write a program to take input for a number, if the number is palindrome, then display its half on the screen, otherwise take input for 2 more numbers, and display their product on the screen. Use minimum two functions including main function2. Assume x, y and z are integer variables with x = 2, y = 5 and z = 10. Each expressionis independent. Determine the results of the following statements and show the step toevaluate them:6.20 LAB: Driving costs - functions Driving is expensive. Write a program with a car's miles/gallon and gas dollars/gallon (both floats) as input, and output the gas cost for 10 miles, 50 miles, and 400 miles. Output each floating-point value with two digits after the decimal point, which can be achieved as follows:print('{:.2f}'.format(your_value)) Ex: If the input is: 20.0 3.1599 the output is: 1.58 7.90 63.20 Your program must define and call the following driving_cost() function. Given input parameters driven_miles, miles_per_gallon, and dollars_per_gallon, the function returns the dollar cost to drive those miles. Ex: If the function is called with: 50 20.0 3.1599 the function returns: 7.89975 def driving_cost(driven_miles, miles_per_gallon, dollars_per_gallon) Your program should call the function three times to determine the gas cost for 10 miles, 50 miles, and 400 miles. I need help with this. Use Python, please.
- 6.10 LAB: Driving costs - functions Driving is expensive. Write a program with a car's miles/gallon and gas dollars/gallon (both floats) as input, and output the gas cost for 10 miles, 50 miles, and 400 miles. Output each floating-point value with two digits after the decimal point, which can be achieved as follows:print('%0.2f' % your_value) Ex: If the input is: 20.0 3.1599 the output is: 1.58 7.90 63.20 Your program must define and call the following driving_cost() function. Given input parameters driven_miles, miles_per_gallon, and dollars_per_gallon, the function returns the dollar cost to drive those miles. Ex: If the function is called with: 50 20.0 3.1599 the function returns: 7.89975 def driving_cost(driven_miles, miles_per_gallon, dollars_per_gallon) Your program should call the function three times to determine the gas cost for 10 miles, 50 miles, and 400 miles. Note: This is a lab from a previous chapter that now requires the use of a function.7) Write a program that reads an integer and uses a single variable to add 5 to the integer, multiply by 6, and divide by 2. The program displays the remainder. * Test your program using the integer 8. * C++C Program In order to discourage excess electric consumption, an electrical company charges its customers a lower rate of P75 for the first 250 kilowatt-hours and a higher rate of P8.5 for each additional kilowatt-hour. In addition, a 10% surtax is added to the final bill. Write a program that calculates the electrical bill given the number of kilowatt-hours consumed as input. At the end, print the number of kilowatt-hours consumed and the computed bill.
- 1. Federal law requires that hourly employees be paid “time-and-a-half” for work in excess of 40 hours in a week.For example, if a person’s hourly wage is $12 and he or she works 60 hours in a week, the person’s gross pay shouldbe (40 *12) + (1.5 *12 * (60-40)) = $840.Write a program that requests the floating number of hours a person works in a given week and the person’s hourlywage as input, and then displays the person’s gross pay. Save it as overtimePay.py3 python programming assume the variables x and y have each been assigned an int. write a fragment of code that assigns the greater of these two variables to another variable named max.(Diameter, Circumference and Area of a Circle) Write a program that reads in the radiusof a circle and prints the circle’s diameter, circumference and area. Use the constant value 3.14159for π. Perform each of these calculations inside the printf statement(s) and use the conversion specifier %f. [Note: In this chapter, we’ve discussed only integer constants and variables. In Chapter 3we’ll discuss floating-point numbers, i.e., values that can have decimal points.]
- d. Given that an int variable s has been initialized, write a statement(s) that declares a new variable andassign it the remainder of 9 times 8 less than s divided by 4. e. Write a statement(s) that initializes the variables named a, b, c and d to false, ''one'', 'y' and 87.9respectivelyQ3: Write a program in which user is asked to enter two integers (divisor and dividend) and computes the quotient and remainder. To compute quotient and remainder, both divisor and dividend should be integers.09. Paint Calculator Write a C program that allows the user to enter values for the width and length of a wall in feet and price per gallon of paint. Assume that a gallon of paint covers 350 square feet of a wall. The program outputs the area of the wall in square feet, the number of gallons needed and the cost of the job.