5) Write a program that reads three numbers and prints "increasing" if they are in increasing order, "decreasing" if they are in decreasing order, and "neither" otherwise. Here, "increasing" means "strictly increasing", where each value is less than the next. The sequence 3 4 4 would not be considered increasing, for example. 6) Repeat Exercise 5, but first ask the user whether "increasing/decreasing" should be "strict" or "lenient". In lenient mode, the sequence 3 4 4 is "increasing", and the sequence 444 is both increasing and decreasing.
Q: Q4. Write a program to read a number and calculate if it is prime or not?
A: #include <iostream>using namespace std; int main() { int i, n; bool isPrime = true;…
Q: Q1) Write a program that Asks for a natural number (Assume that number is n) Draws the following…
A: As programming language is not mentioned, so we are providing answer in C++ language.
Q: 3.4 LAB: Seasons Write a program that takes a date as input and outputs the date's season in the…
A: complete answer is solved using C++ Programming Language.
Q: Q1) Write a program to test the degrees of 100 students, If the student's degree is a floating. it…
A: C++ Code for above : #include <bits/stdc++.h> using namespace std; int main() {…
Q: 3. Write a program that checks the screen time of a child and repeats this procedure three times.…
A: Algorithm: Start Read age of child If age is less than or equal to 5, display "Your child should…
Q: Java
A: Program: //Import necessary packages import java.util.Scanner; //Define a class named Months public…
Q: 17. Write a program that calculates and print the numbers (from 0 to 10) and it squares and cubes.
A: Mathematically we know that square of a number is its multiplication by itself. For example if n is…
Q: 1. Write a program that reads in two integers and determines and prints if the first is a factorial…
A: Please find the answer below
Q: Q1: Write a program that read 10 Marks and print number of failed and succeeded marks.
A: Note: As no programming language is mentioned, therefore answering in python. Input to the Program :…
Q: 1. Write a program that prompts the user to enter an integer between 0 and 6 and prints thie day…
A: I give both codes in C along with output and code screenshots.
Q: Q2: Write a program that inputs a five-digit integer, separates the integer into its individual…
A: Start Input number Continue till number becomes 0 Store last digit in array Divide the number by…
Q: Twin primes are two primes that differ by 2 (e.g., 3 and 5, 101 and 103). Write a ++ program that…
A: Program AlgorithmDeclare the required variables and an array of 1000 elements in main().Then use a…
Q: Write TRUE if the statement is true, otherwise, write FALSE. 5. The negation of (P ∧ Q) =⇒ (P ∨ Q)…
A: In step 2, I have provided ANSWER with brief explanation---------------
Q: 3.5 LAB: Exact change Write a program with total change amount as an integer input, and output the…
A: Here I am using Java language to solve this question. Java Code: import java.util.*; public class…
Q: Write a program in which user is asked to enter two integers (divisor and dividend) and computes the…
A: Program Explanation :- In this Program, the user is required to enter two numbers (separator and…
Q: Excercise2: write a program to print the name of day when entering the number of the day. (For…
A: Since you have not mentioned programming language I'm doing this in c++
Q: · Exercise # 1: Wite a program that determines the day number (1 to 366) in a year for a date that…
A: Here, we have to write programs for the above programs.
Q: Exercise 30 defines the number e and Exercise 31 shows how to approximate the value of e using a…
A: Since no programming language is mentioned. I am attempting this in python. if you need it in any…
Q: //////////// //////////// //////////// how do i solve this problem in java. please do not use…
A: Program Instructions:Use scanner class object to get the user input.Use if-else statements to print…
Q: Q5: Write a program takes two integers numbers from the user and prints the following: 1-The result…
A: Note: Below is the required program in java language. Program Approach: Importing necessary package…
Q: Exercise 1: In this exercise we are asked to write a program that prompts the user for a positive…
A: Input n if(n>0) { while(n>0) { r=n%10; //find remainder…
Q: Q1) Write a program that takes as input any change expressed in Saudi Riyals. It should then compute…
A: //Note: Always the language of code in which you want the result. //For Now I am doing this in java…
Q: Question 5: Write a program that inputs four strings that represent floating-point values, converts…
A: NOTE: SINCE THE LANGUAGE OF THE CODE IS NOT MENTIONED, I HAVE USED C FOR THE SOLUTION Define header…
Q: Activity #2: Write a program that computes parking fees for a garage with the fee structure given in…
A: Objective: This program reads the number of hours parked for vehicles and computes the total charge.…
Q: 04 write a program that accepts a day, month and year then calculate the day of year corresponding…
A: I will explain this question in details,
Q: Write a program that takes in a line of text as input, and outputs that line of text in reverse. The…
A: C++ Program for above : #include <iostream> #include <algorithm> #include…
Q: Q4 write a program that accepts a day, month and year then calculate the day of year corresponding…
A: Given requirement, Write a program that accepts a day, month and year then calculate the day of the…
Q: Q3] ( 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: In mathematics function is the expression or rule or law which defines the relationship between the…
Q: 2. Write a program that determines a student's grade. The program will read three scores and…
A: Below is the required C++ program: - Approach: - Import the header file and include the namespace.…
Q: Exercise 6: Two points in a plane are specified using the coordinates (x1, y1) and (x2, y2). Write a…
A: Since it is unclear which question you want, my code below is answer to both questions 6 and 7.
Q: 1. Write program to check whether a number is Palindrome or not. [Hint]: A palindrome number is a…
A:
Q: 4) The price of stocks is sometimes given to the nearest eighth of a dollar; for example, 29 7/8 or…
A: #include<iostream> using namespace std; double stockCost(int x, int y, int z, int stock); void…
Q: 01) Write a program that reads the integers between 1 and 100 and counts the occurrencesof each.…
A: PROGRAM CODE: import java.util.Scanner; public class Main { public static void main(String[]…
Q: Question1: write a program to print out the following figu by QBasic * * * * * *
A: Required:
Q: 3. Write a program that checks the screen time of a child and repeats, this procedure three times.…
A: #include<stdio.h>int main(){ int age; float screen_time; for(int i=0;i<3;i++){…
Q: Exercise 1:1 write a program that reads three variables of real type, and then prints in ascending…
A: write a program that reads three variables of real type, and then prints in ascending order.
Q: Complete the following sentences by filling the right word The purpose of (int) in the statement:…
A: Answer: The purpose of (int) in the statement: int x = (int)(Math.log(16)); is toint x = (int)…
Q: 7- Write a program to input number of 3 digits and check whether it is Armstrong Number or Not.…
A: Write a program to input number of 3 digits and check whether it is Armstrong or not. * Your not…
Q: In the below given program there is an error, find the error and write the correct statement.
A: In assignment statement num2 variable is not passed, hence it will return syntax error, num not…
Q: (Diameter, Circumference and Area of a Circle) Write a program that reads in the radiusof a circle…
A: #include <stdio.h> int main() { float r; printf("enter radius :- "); scanf("%f",&r);…
Q: Java , we are learning decisions and branch statements.
A: Program: //Import necessary packages import java.util.Scanner; //Define a class named Smallest…
Q: 1. Federal law requires that hourly employees be paid "time-and-a-half" for work in excess of 40…
A: #ask user for hourly wage hourly_wage = float(input('\nEnter hourly wage: ')) #ask user for Number…
Q: 3. The program that asks a number and test the number whether it is multiple of 5 or not, divisible…
A: #3. number = int(input("Enter a number: ")) # taking the number from user if…
Q: Q2. Write a program to calculate tax collection according to the following formula: 10.5 % Tax, if…
A: Hello Student. Warm welcome from my side. Hope you are doing great. Here's your answer. Since you…
Q: 2. Write a program to read a number. If the number is a multiple of 3, then enter three new numbers…
A: Question 2 is given below
Q: 2- Write a program to enter(15) numbers by using inputbox function and then find the average of…
A: 1. declare two functions textbox and input box.2. in inputbox function take the 15 numbers from…
Q: Write true if the two statements are equivalent; otherwise write false. (p∨∼q) ∨q and p
A: Here in this question we have given two statement and we have asked to write true if they are…
Q: Lab #05 Exercise Write a program to enter 2 out of 3 angles in a triangle, in degrees. Your program…
A: Please give positive ratings for my efforts. Thanks. PROGRAM a = float(input("Enter the first…
Trending now
This is a popular solution!
Step by step
Solved in 4 steps
- 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 anddecreasing9- Write a program which read a number of 3 digits and check if (units, tens, hundreds) digit is greater than 5, convert this digit to 5. FOR eg. 147 After check 145 983 After check 5535) Write a program that reads three numbers and prints "increasing" if they are in increasing order, "decreasing" if they are in decreasing order, and "neither" otherwise. Here, "increasing" means "strictly increasing", where each value is less than the next. The sequence 3 4 4 would not be considered increasing, for example. 6) Repeat Exercise 5, but first ask the user whether "increasing/decreasing" should be "strict" or "lenient". In lenient mode, the sequence 3 4 4 is "increasing", and the sequence 4 44 is both increasing and decreasing.
- A mail order house sells five different products whose product numbers and retail prices are: product 1 - $2.98, product 2 - $4.50, product 3 - $9.98, product 4 - $4.49, product 5 - $6.87. Write a program that reads a series of pairs of numbers (from user). That is, each time it reads the pairs of values as follows: i) product number ii) quantity of that product sold Your program should use a switch statement to determine the retail price for each product. Your program should calculate and display the total retail value of all products sold. Use a sentinel-controlled while loop so user can indicate when the program should stop looping and display the final results.6. A palindrome is a number or text phrase that reads the same backwards or forwards. For example, each of the following five-digit integers is a palindrome: 12321, 55555, 45554 and 11611. Write a program that reads a 5 digit integer and determines whether it is a palindrome. Hint: One way to do this is to use division (/) and modulus (%) operators to separate the number into individual digits.1. Write program to check whether a number is Palindrome or not. [Hint]: A palindrome number is a number such that if we reverse it, it will not change. For example some palindrome numbers examples are 121, 212, 12321 , 454.
- 5- Write a program which read a number consists of 4 digits and find the maximum digit of the number. FOR eg. 1472 the maximum digit is 7 the maximum digit is 9 9835The course grades of 75 students from 5 courses are given in the form of a table. Write an algorithm that writes "cannot be entered" for those with an average of less than 40 course grades, and "can be entered" for 40 and above. (Please explain everything the program in details and please check whether the program runs or not by using q-basic64. 01:444- Write a program that reads the average of 30 students and find the number of pass students , the number of fail students then print the results. 5- Write a program that reads 20 numbers then find the number of negative and positive numbers and the number of numbers equal to zero and print the results. 6- Write a program to read three numbers A,B,C then find whether A,B,C can form the sides of a triangle, if yes compute the parameter of the triangle , if no print the massage ( not a triangle), then determine whether A,B,C form the side of an (a)) equilateral triangle ,b) isosceles triangie ,c)) right angle triangle Hint: ( A,B,C can form a triangle if each side is less than the sum of the other two sides)
- Singular to Plural. Create a program that accepts a word in singular, and produces the corresponding plural. Use the following rules: a. If the word end in ‑s, -ss, -sh, -ch, -x, or –z, then add –es to the word. For example, the plural of tax is taxes b. If the word ends in -fe, then replace the ending with –ves. For example, the plural of wolf is wolves c. If the word ends in y and the previous letter is a vowel, then add –s to the word. For example, the plural of boy is boys d. If the word ends in y and the previous letter is a consonant, then change the –y ending with –ies. For example, the plural of city is cities e. If the word does not meet the criteria above, then add –s to it.1. Write a program that asks the user to enter three names, and then displays the names sorted alphabetically in descending order. For example, if the user entered "Charlie", “Leslie", and "Andy", the program would display: Leslie Charlie Andy Note that these three names are just an example. The names could be any words. 2. Write a program that asks the user to enter a year, and then displays whether that year is a leap year or not. Note that a year is a leap year if the year is a multiple of 400, or it is a multiple of 4 and not a multiple of 100. 3. Write a program to repeatedly read integers from the standard input until it reads -1 and exits. For each number before -1, if it is positive and odd, do the following: • Output a triangle like the one below with the integer being the width of the triangle's bottom or the number of asterisks of the bottom row. For instance, if the integer is 7, you would display the triangle below: *** ***** Or if the integer is not positive or not odd,…1. Write a an algorithm that asks the user to input a positive integer n and counts how many of the squares of the integers from 1 to n end in a 1.2. Write a an algorithm that asks the user to input a positive integer n and counts how many of the squares of the integers from 1 to n end in a 4 and how many end in a 9.