4- 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.
Q: a program that stores and prints the months of a year:
A: a program that stores and prints the months of a year:
Q: Assume that start and end are integers. Return the average all of the numbers from start to end…
A: def average(start,end): avg = (start+end)/2.0 return avg x = average(3,5)print('The average is…
Q: There are 50 lighting lamps, numbered 1 to 50, on a car race track. Initially all lamps are off. 10…
A: create a list of 50 booleans initialized with False (False => OFF, True => ON) running outer…
Q: Write a program that takes a range from the user and display all the even numbers between the range…
A: Note - Since there is nothing mentioned about the programming language to be used, so this program…
Q: 1- Write a program to find the average of 50 numbers and print the result. 2- Write a program to…
A: program for average of 50 number : #include <iostream> using namespace std; int main() {…
Q: write answer. After verify ing got wrong again and again .
A: I have answered below:
Q: > Example: Rewrite the previous code by using nested if condition. grade (x) := if x 2 60 out "you…
A: Here we are taking marks as an input and as a output we get grade of a student if student is less…
Q: 2- Write a program to check a given integer number if it is divisible by 7 or not. 3- Write program…
A: 2, c++ program to fing the program is divisble by 7 : // A Program to check whether a number is…
Q: Write a program that displays every integer between 1 and 100 that is divisible by 5 or 7, but not…
A: Algorithm: 1.Include required header files 2.include main function 3.create a for loop 4.use if…
Q: Write a program which prints words of a string in reverse order for example if a user enter “I love…
A: Code: i am giving the code in java as you have not mentioned the language import java.util.Scanner;…
Q: There are 50 lighting lamps, numbered 1 to 50, on a car race track. Initially all lamps are off. 10…
A: Given: To write the program in C and Python to finds out and display on the screen which lamps are…
Q: Homework-4 Write a program read x value then compute S value from the following series: 1 (X – 1y +…
A: Note: Answering in python as no language is specified. Input to the Program : Four different values…
Q: Qi- Write a program to print (very high) if the windspeed is more than 220, or print (high) if…
A: IF/else statement expands the if statement if / else statement if (true / false expression) is…
Q: Write a program that calculates the electricity bill. The rates of electricity per unit are as…
A: A function is a square of code which possibly runs when it is called. You can pass information,…
Q: 1- Write a program to enter average and find the grade rating() (Excellence, Very good, Good,…
A: NOTE NO PROGRAMMING LANUAGE IS MENTIONED SO I WAS USED C++ LANGUAGE 1) #include…
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: Two positive integers are called amicable if the sum of divisors of the first is equal to the sum of…
A: Given: To Write a Java program to test if 2 integer numbers are amicable. For example, 220 and 284…
Q: 5. Write a program that prints a Christmas tree, as shown below. Remember to use escape sequences.…
A: The above program is solved using Java Program below:
Q: 4- Write a program that reads the average of 30 students and find the number of pass students , the…
A: As per the subject guidelines, we can answer only the first question in case of multiple questions.…
Q: There are 50 lighting lamps, numbered 1 to 50, on a car race track. Initially all lamps are off. 10…
A: C Program for above : #include <stdio.h> int main() { //50 lamps; int…
Q: Create a program to accept a number and identify if this number is even or odd number
A: number = int(input("Enter an number: ")) if (number % 2) == 0: print("{0} is…
Q: Write a program to check whether the given number is even or odd.
A: NOTE : As the question is not specific about the programming language to be used to write the code ,…
Q: Tera __________________ is Better known as _______________.
A: Given fill in the blank question is based on storages.
Q: Voltage readings are obtained from an electrical substation once every hour for six hours Write a…
A: The Program language is not mentioned here. So, I am using C language to answer your question. The C…
Q: 3- Write a program to read a sequence of integers (n), then print the number of the positive and…
A: Start Input value of n from user For n times Input number If number greater than 0, then increment…
Q: What is the range of values that x can hold after this statement is executed? double x =…
A: Answer:A perform is increasing within the same vary wherever it's spinoff is positive. Now, notice…
Q: Question 1 Write a program that asks the user to enter the number of passengers in an airplane and…
A: "Since you have not mention any programming language, so will write our program in C language." C…
Q: (Separating Digits in an Integer) Write a program that inputs one five-digit number, sep- arates the…
A: answer is in the 2nd step
Q: Task 3: Find the numbers that can be expressed as the product of two nonnegative integers in…
A: Below is the required Flowchart: -
Q: 3- Write a program which accept a number of 2 digits and check if ones digit is greater than the…
A: C++ Program for above : #include <bits/stdc++.h> using namespace std; int main() {…
Q: 3- Given S= 1 + 3! 5! ,correct the following program which describes the series S,. 7! 9! S=2; m=1;…
A: Error in the above program: Variable S's initial value should be 1 instead of 2. f = f*i will…
Q: There are 50 lighting lamps, numbered 1 to 50, on a car race track. Initially all lamps are off. 10…
A: ## As no language mentioned, we write the code in Python language. lamp = [0]*50…
Q: Write a program that prompts the user to enter two integers.
A: Since the programming language is not mentioned in the question, we will answer this question in C++…
Q: Jump to level1 Write multiple if statements: If car_year is before 1967, print "Probably has few…
A: NOTE: Since programming, langauge is not mentioned. Therefore answering questions in Python…
Q: Two positive integers are called amicable if the sum of divisors of the first is equal to the sum of…
A: Amicable Numbers: Amicable numbers are two numbers that are equal to the sum of their respective…
Q: Two positive integers are called amicable if the sum of divisors of the first is equal to the sum of…
A: Hello Student. Warm welcome from my side. Hope you are doing absolutely amazing. As you have not…
Q: There are 50 lighting lamps, numbered 1 to 50, on a car race track. Initially all lamps are off. 10…
A: There are total 50 lighting lamps Numbered 1 to 50 Car race track initially all lamps are off.
Q: There are 50 lighting lamps, numbered 1 to 50, on a car race track. Initially all lamps are off. 10…
A: // As no language mentioned, we write the code in C++ language. #include<iostream>…
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: 1. A 10% discount is applied to purchases over $10.00. Write a program that asks for amount…
A: The program is created as follows: Declare variables for purchase amount, discount and discounted…
Q: Q1\Write a program that sums the numbers between 1 and 9 and finds the sum total
A: Here language is not mentioned so i write c code to sum between 1 to 9: (2+3+4+5+6+7+8)…
Q: 5-3) (Find the highest score) Write a program that prompts the user to enter the number of students…
A:
Q: Find the numbers that can be expressed as the product of two nonnegative integers in succession and…
A: Script:- #reading the input number fromm user read -p "Enter number: " number #setting count to 0,…
Q: Question # 8: Write a program that inputs a number and checks whether it is a perfect number or not.…
A: Answer 8: Objective: The program reads the user input and verifies if the number falls under the…
Q: Two
A: import java.util.Scanner; public class Main{ public static void main (String args[]) { int…
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: 5- Write a program that asks the user to enter an angle in degrees and prints out the sine of that…
A: Coded using C++.
Max Function
Statistical function is of many categories. One of them is a MAX function. The MAX function returns the largest value from the list of arguments passed to it. MAX function always ignores the empty cells when performing the calculation.
Power Function
A power function is a type of single-term function. Its definition states that it is a variable containing a base value raised to a constant value acting as an exponent. This variable may also have a coefficient. For instance, the area of a circle can be given as:
Step by step
Solved in 4 steps with 2 images
- 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 anddecreasing4- 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). Task 3: Find the numbers that can be expressed as the product of two nonnegative integers in succession and print them in increasing order. (For example, 30 is such a number as it can be written as the product of 5 and 6 (30=5x6), which are two numbers in succession.) The user should specify a maximum value and the program should print all said numbers smaller than or equal to that value. The program should keep a count of how many numbers were printed and should output that count ,as well as the numbers
- Problem Description: In the Whimsical Library, each book is enchanted with a magical code to ensure the protection of knowledge. The validation process for these magical codes involves a combination of mathematical spells. The validation process is described as follows: Take the sum of the digits at odd positions from left to right. Take the sum of the squared digits at even positions from left to right. If the absolute difference between the results from step 1 and step 2 is a prime number, the book code is considered valid; otherwise, it is invalid. Example 1: Consider the magical book code 86420137. Step 1. Take the sum of the digits at odd positions from left to right. 8+4+0+3=15 Step 2. Take the sum of the squared digits at even positions from left to right. 6^2+2^2+1^2+7^2=36+4+1+49 = 90 Step 3. If the absolute difference between the results from step 1 and step 2 is a prime number. 115-901 75 (not a prime number) Book code 86420137 is invalid. Example 2: Now, let's examine the…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 98351. 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.
- Task 3: Find the numbers that can be expressed as the product of two nonnegative integers in succession and print them in increasing order. For each number found the program should check whether the number is a multiple of 5 and indicate this in the output. (For example, 30 is such a number as it can be written as the product of 5 and 6 (30=5x6), which are two numbers in succession.) The user should specify how many such numbers they want to print. Your application should be user friendly. First, you create an initial menu that the user sees when they execute the application. The menu should display the list of operations (the three tasks) that the application can perform. In your menu design, if user enters M or m, the application should print a list of the multiples of the number The user specifies how many numbers to print. The program should display the user’s selection before printing the output. If the user enters a selection which is different from the choices offered, the…Q1/ Write a program that reads from the user the number of students in the class and their grades in one class, the program must find the largest and the lowest grades with the sequence of students and then find the average grade of the class, see the example below: N is the numbers of students in one class X is the grade for each student in the class For example Student # 1 = 89 Student # 2= 60 Student # =80 You must find the largest and the lowest grades with the sequence of the student. The largest grade is 89 the student's number is 1 The lowest grade is 60 the student's number is 2 The average grade of the class is 76.333Task 3: Find the numbers that can be expressed as the product of two nonnegative integers in succession and print them in increasing order. For each number found the program should check whether the number is a multiple of 5 and indicate this in the output. (For example, 30 is such anumber as it can be written as the product of 5 and 6 (30=5x6), which are two numbers in succession.) The user should specify how many such numbers they want to print. -- You need to draw the main flowchartwhich will show the logic of your entire application --
- 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.Q1: Write a program that reads 10 numbers and then finds the largest number and prints it and finds the smallest number and prints it.Q1/ Write a program that reads from the user the number of students in the class and their grades in one class, the program must find the largest and the lowest grades with the sequence of students and then find the average grade of the class, see the example below: