3) Write a program that reads an integer and prints how many digits it has by checking whether the number is >= 10, >= 100, and so on. However, if the number is greater than a million, just print "lots". If the number is negative, then first multiply it by -1.
Q: Many companies use telephone numbers like 555-GET-FOOD so the number is easier for their customers…
A: PROGRAM: #while loop while True: #Getting input from the user phoneNum = input('Enter the number…
Q: Write a program that takes the user age and prints the following: Print too old, if age is greater…
A: Use if else if statements to check all the conditions one by one
Q: 4. Before you can cross a bridge with your car, it must weigh within +/- 100 pounds of 1 ton For…
A: Hey, since multiple questions posted, we will answer first question according to our policy. If you…
Q: 10) Write a program that translates a letter grade into a number grade. Letter grades are A, B, C,…
A: note:- always mention programming language name in question, this is done in python. logic:-…
Q: Write a program that accepts a number of minutes and converts it both to hours and days. For…
A: As no programming language is mentioned it is solved using basic C++
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 that takes your full name as input and displays the abbreviations of the first and…
A: NOTE: SINCE THE LANGUAGE OF THE PROGRAM IS NOT GIVEN, I HAVE USED PYTHON FOR THE SOLUTION Define…
Q: 2. Write a complete program that prompts the user for a test score and prints out the letter score…
A: Here I written Java code for given problem. I hope you like it.
Q: Write a program that displays the differences between the first and last, the second and next to…
A: Program description: n is the user input integer variable that stores the number of elements in the…
Q: Write a program using if, and elif and else, that asks the user what their favorite food is. Then…
A: We need to read a string and compare the string with list of favorite food.
Q: Write program to print "OK" if the number is even and greater than 100 or the number is even and…
A: Conditional statement: A programming language allows to test or check the condition to control the…
Q: Write a program that reads ten integers, and then display the number of even numbers and odd…
A: The given program is in the C++ programming language.
Q: 5. Write a program that reads 3 items, item1, item2, item3, from the keyboard a. if 1 and 2 are the…
A: I give the code as per your requirement along with output and code screenshot in python
Q: Write a program that prompts the user to enter the minutes (e.g., 1 billion), and displays the…
A: NOTE: SINCE THE LANGUAGE OF THE CODE IS NOT MENTIONED, I HAVE USED JAVA FOR THE SOLUTION. Define…
Q: write a program that reads the height in centimeters and then converts the height to feet and…
A: NOTE: As the programming language is not mentioned in the question. So, we have solved this question…
Q: a program which repeatedly reads positive numbers until the user enters -1. Once -1 is entered,…
A: It is defined as a powerful general-purpose programming language. It can be used to develop software…
Q: Write a program that prompts the user to enter theminutes (e.g., 1 billion), and displays the number…
A: Program code: //IMPORT Scanner class import java.util.Scanner; //define a class NoOfYears public…
Q: 7. Write a program that asks the user's name, and then greets the user by name. Before outputting…
A: The problem is based on writing the code to input users' name and to greet the user after converting…
Q: The ancient Greeks classified numbers geometrically. For example, a number was called "triangular"…
A: A number is said to be a triangular number if the sum of the dots in the number is equal to the sum…
Q: A word is called as a good word if all the letters of the word are distinct. That is, all the…
A: Actually, python is a easiest programming language. It has a concise(less) code.
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 that reads from the user the initial KiloMeters of the car, the current KiloMeters,…
A: Note: as programming language is not mentioned c++ is used. The program with output is given below
Q: Write a program that prompts the user to enter an integer and checks whether the number is divisible…
A: The c++ program is given below, as language is not mentioned.
Q: Write a program which prompts the user for a number and prints the numbers from 1 up to that number,…
A: ALGORITHM:- 1. Take the value of n as input from user. 2. Generate the numbers from 1 to the input…
Q: Write a program that asks the user to input 10 numbers and counts how many odd numbers that user…
A: Algorithm:- (I) declare array of size 10. (II) using loop take input . (III) use modulo 2 to…
Q: Write a program that reads at most 100 integers between 1 and 100 and counts the occurrence of each…
A: C program is given below:
Q: Write a program that reads a four-digit number from user, then the program separates digits of the…
A: code
Q: 9) Write a program that reads a temperature value and the letter C for Celsius or F for Fahrenheit.…
A: According to the question below the solution: Output:
Q: 2. Write a complete program that prompts the user for a test score and prints out the letter score…
A: import java.util.Scanner;public class Main{ public static void main(String[] args) { Scanner sc…
Q: Write a program that prints the day number of the year, given the date in the form month-day-year.…
A: Programming Approach Declare a header file. Using namespace. Define function prototypes Declare a…
Q: Write a program to read basic salary (bsalary) and sales (sales) then calculate and print the net…
A: C++ program for above : #include <bits/stdc++.h> using namespace std; int main() {…
Q: Write a program that reads non-negative integer number and determines whether it is odd or even or…
A: Here we will write a program that reads non-negative integer number and determines whether it is odd…
Q: 9. Write a program that inputs two real numbers then exchanges their values. 10. Make a program that…
A:
Q: Write a program that reads an integer and displays its first five multiples. For example, if the…
A: #asking for the inputa=int(input("Enter a number : "))#loop for the 5 multiplicantsfor b in…
Q: 5. Write a program that computes the spherical distance between two points on the surface of the…
A: i tried like this in java code: java code: public class Test { static double compute(double…
Q: Write a program that invites the user to enter two numbers: a dividend (the top number in a…
A: According to the Question below the Solution: Output:
Q: Write a program that takes your full name as input and displays the abbreviations of the first and…
A: Note: Programming Language not specified using C++ to implement code: //include the necessary…
Q: Write a program that reads 6 integers and displays the largest and the smallest amongst those…
A: C++ code: To displays the largest and the smallest amongst 6 integers #include <iostream>using…
Q: Write a program that takes in the user’s name and age. Then displays his/her name’s initial letter…
A: Algorithm: Start Var name, age Accept name from user Accept age from user Display(name[0]) Display…
Q: Write a program that reads a number in feet, converts it to meters, and displays the result. One…
A: PROGRAM CODE: import java.util.Scanner; public class Main { public static void main(String[] args) {…
Q: 5. Write a program that computes the spherical distance between two points on the surface of the…
A: java code: public class Test { static double compute(double lat1, double lon1,…
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 that asks the user to enter two numbers, obtains the two numbers from the user and…
A: Given: Write a program that asks the user to enter two numbers, obtains the two numbers from the…
Q: write a program that prompts the user to enter the number of students and each student name and…
A: The java program and the approach that prompts the user to enter the names and the scores of the…
Step by step
Solved in 2 steps with 3 images
- Write a program that displays every integer between 1 and 100 that is divisible by 5 or 7, but not both. Write it using While and for.Write a program that reads in three integers and then determines and prints the largest and the smallest integers in the group. Use only the programming techniques you have learned in this chapter.Three numbersa. Write a program that reads three numbers and prints “all the same” if they are allthe same, “all different” if they are all different, and “neither” otherwise.b. Write a program that reads three numbers and prints “increasing” if they are inincreasing order, “decreasing” if they are in decreasing order, and “neither”otherwise. Here, “increasing” means “strictly increasing”, with each value largerthan its predecessor. The sequence 3 4 4 would not be considered increasing.c. Repeat part b. but before reading the numbers, ask the user whetherincreasing/decreasing should be “strict” or “lenient”. In lenient mode, thesequence 3 4 4 is increasing and the sequence 4 4 4 is both increasing anddecreasing
- f. A laborant in a laboratory does a number of antigen tests in one day. Write a program that simulates the number of antigen tests done in a day in a laboratory, displays the number of positives and negatives, and calculates the % of positives in one day. Your program needs to first generate a random number that will show the number of tests done in a day. One laboratory in a day cannot do more than 100 tests and less than 1 (they do at least one). Then for each of the tests, your program needs to generate a random number to show whether they are positive or negative. In order to write this program, you need to have the following three functions used by the main function: test result (void): This function generates a test result. It should randomly return either one or zero. 1 means positive test result and 0 means negative test result. float positive percentage (int,int) : This function takes the total number of positives and the total number of tests and returns the % of positives.…The monthly payment for a givenloan pays the principal and the interest. The monthly interest is computed by multiplyingthe monthly interest rate and the balance (the remaining principal). The principalpaid for the month is therefore the monthly payment minus the monthly interest.Write a program that lets the user enter the loan amount, number of years, and interestrate then displays the amortization schedule for the loan. Here is a sample run: Loan Amount: 10000 ↵EnterNumber of Years: 1 ↵EnterAnnual Interest Rate: 7 ↵EnterMonthly Payment: 865.26Total Payment: 10383.21Payment# Interest Principal Balance1 58.33 806.93 9193.072 53.62 811.64 8381.43...11 10.00 855.26 860.2712 5.01 860.25 0.01Airline companies apply baggage restrictions for their passengers. An airline company has decided to apply a 10kg limitation for passengers' hand luggage and 20kg for their normal baggage. When passengers arrive, they enter their hand and normal luggage weight from the keyboard. If passengers exceed their normal baggage allowance of 10 dollars per gram, they pay 12 dollars per kg. Accordingly, write the program that calculates the baggage price of the airline they will go to according to the baggage values entered by the arriving passenger and keeps this from closing the program for each passenger. Note: If hand and normal baggage allowances are stretched below the maximum value, the payment amount will be considered not negative. An example printout is given on the right. Geri bildirim gönder
- Coin Exchange: Write a program that will determine how many coins of each denomination (50kr, 25kr, 10kr, Skr, and 1kr) are required to make up a given amount of change. For example, to make 57kr we could use 1 x 50kr, 1 x 5kr, and 2 x 1kr., It should be obvious that many combinations of coins are possible. For example, in the example above, we could make up 57kr with: (57 x 1kr) or (2 x 25kr and 7 x 1kr). However, your program must use the smallest number of coins (10 points). Example program output: Enter amount: 40 40 Kr = 1 x 25Kr 1х 10Кr 1 x 5KrWrite a program that displays all possible combinations for picking two numbers from integers 1 to 7. Also display the total number of combinations.Let n be a nonnegative integer. The factorial of n, written n!, is defined by 0!=1, n! =1*2*3*...n if n >= 1. For example, 4! = 1*2*3*4 = 24. Write a program that prompts the user to enter a nonnegative integer and outputs the factorial of the number.
- Write a program that reads from the user a character (*q' or 'c'). If the character is 'c', the program reads from the user the radius r of a circle and prints its area. If the user enters 'q', the program asks the user to enter the length and width of a quadrilateral. We assume the quadrilateral is either a square or rectangle. You should print if the quadrilateral is square or rectangle. Otherwise, it prints "Wrong character" PS: Use the following formulas : area of circle=3.14*r? I2. Party shop sells birthday gift bags in two ways. set of 12 bags for $17.99 or an individual bag for $1.75. Customers can purchase a Write a complete program that asks the user input for the number of gift bags need to be purchased (an integer) and outputs the total price of the purchase. a) For example, if the customer buys 14 gift bags, the customer would be charged for 1 set of (12 bags) plus another 2 individual bags. The subtotal would be 1 (17.99) + 2 (1.75) = $21.49. b) Use a constant variable to set a fixed tax rate of 8.875. c) Display correct dollar values (2 decimal places, use cout precision). User input can be any content and it's bold and italicized for clarity. Example Output 1 Welcome to Party Shop! How many gift bags would you like to purchase: 14 SHOPPING CART 1-set (s) $17.99 2-individual $3.50 Subtotal: $21.49 Таx: $1.91 Total: $23.40 Thank you shopping Party Shop! Example Output 2 Welcome to Party Shop! How many gift bags would you like to purchase: 11 SHOPPING…A palindromic number is a number that is the same when written forwards or backwards. The first few palindromic numbers are therefore are: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 22, 33, 44, 55, 66, 77, 88, 99, 101, 111, 121, 323 Input a number from the user. Write a program that reverses the digits of a number. Use this program to find if the number is a palindrome. Print if the number is palindrome or not.