* Given two integers, the second larger than the first, this program: 1) prints the even numbers between the first and second number inclusive 2) prints the sum of those even numbers 3) prints the odd numbers between the first and second number inclusive 4) prints the sum of those odd numbers * * * * Example: * Enter an integer: 10 Enter one larger than the first: 20 Even numbers: 10 12 14 16 18 20 * * Sum of even numbers 90 Odd numbers: 11 13 15 17 19 Sum of odd numbers 75
Q: A triangle is considered valid if the sum of each 2 sides is greater than the remaining third side.…
A: We have to write a program a program that takes the length of three sides and print "equilateral",…
Q: ///////////// //////////// //////////// the language used is java
A: Program code #1:
Q: : Write a program c++ to find the smallest number of n integer numbers where n is entered by user.…
A: Given data is shown below: Q: Write a program c++ to find the smallest number of n integer numbers…
Q: The following equation estimates the average calories burned for a person when exercising, which is…
A: As per the given problem, the formula for calculating the calorie is : Calories = ( (Age x 0.2757) +…
Q: Madison County collects property taxes on the assessed value of property, which is 60 percent of its…
A: Madison County collects property taxes on the assessed value of property, which is 60 percent of its…
Q: Q5: (Count positive and negative numbers and compute the average of numbers) Write a program that…
A: Step 1:- Note:-I am writing the program in the java programming language Program Approach:-…
Q: Part H: Worker Pay Write a program that asks the user to enter their name, pay rate (in $/hr) and…
A: steps for calculating total amount is if hour > 40: total = 40 * rate + (hour-40) * 1.5 * rate…
Q: (Count the number of Vowels and Consonants) Write a program that reads an unspecified number of…
A: Use Infinite loop for accepting input from user and write a condition to exit from loop
Q: 6. (Display the first days of each month) Write a program that prompts the user to enter the year…
A: Hey, since there are multiple questions posted, we will answer first question. If you want any…
Q: Part B: Chore Bonus Your parents pay you $3 for each trash bag full of leaves you rake. If you can…
A: According to the information given:- We have to follow the instructions mentioned to get the desired…
Q: Lab p-1) Write a program that calculates the following math equation: |axb e a=30, b=23, c=13
A: 1)calculate first d=a*b 2)next calculate d/c into e 3)calculate f into square root of e using…
Q: A prime number is called an Additive prime if the sum of its dig- its is also a prime number. Write…
A: Loops in C++: A loops repeatedly executes statements until a given condition is true. Before…
Q: Use this table to convert digits to barcode representation and vice-versa; each digit is represented…
A: we are going to convert the following zip code into bar code-
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: (Count positive and negative numbers and compute the average of numbers) Write a program that reads…
A: import java.util.*;import java.lang.*;import java.io.*; class Codechef{ public static void main…
Q: Find the numbers that can be expressed as the product of two nonnegative integers in succession and…
A: Note :- You have not mention the language of program ,So i am doing your question in C++ language.…
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: Write a code that prints the Fibonacci series backwards. Prompt for and input two integers in the…
A: #include <stdio.h> int main() { printf("Enter two numbers in fibonacci series:"); int…
Q: Write a Program to enter the numbers till the user wants and at the end it should display the count…
A: Code :
Q: 5.17 LAB: Countdown until matching digits Write a program that takes in an integer in the range…
A: Given: To write a code.
Q: (Summing Integers) Write a program that uses a for statement to sum a sequence of integers. Assume…
A: As the programming language is not mentioned so I am writing a code in C++ language. Program…
Q: Armstrong numbers between two intervals Write a program to print all the Armstrong numbers in the…
A: Find Your Code Below
Q: using c++ please Write a program that inputs a sentence from the user and counts the number of…
A: C-string : A c-string is an array of characters of fixed size set at the time of the declaration.…
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: 2.26 LAB: Expression for calories burned during workout The following equation estimates the average…
A: I have provided JAVA CODE along with CODE SCREENSHOT and also provided 2 OUTPUT…
Q: (Count positive and negative numbers and compute the average of numbers) Write a program that reads…
A: The C++ program is written where it takes the input from the user and counts the positive and…
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: The following equation estimates the average calories burned for a person when exercising, which is…
A: Step1 : inputs age (in years), weight (in pounds), heart rate (in beats per minute), and time…
Q: /** * Given two integers, the second larger than the first, this program: * 1) prints the even…
A: The below given Java program will obey the following rubrics: Importing required data package.…
Q: z=0 i=2 x=int(input("Enter any number") while i<=n: z=z+i/i+2 print(z) i=i+1 for the above program,…
A: Code: z=0i=2x= int(input("enter any number"))#reading user input#while loopwhile i<=x:…
Q: he following equation estimates the average calories burned for a person when exercising, which is…
A: Required: The following equation estimates the average calories burned for a person when…
Q: (Find the two lowest scores) Write a program of C++ that prompts the user to enter the number of…
A: Actually, c++ is a powerful general purpose language.
Q: *4.1 (Count positive and negative numbers and compute the average of numbers) Write a program that…
A: Integer:- In Java, int is a primitive data type while Integer is a Wrapper class. int, being a…
Q: Write Algorithm for a program that asks the user to enter two numbers. Then ask the user to enter…
A: Here I am Providing A Basic C Program For elaborating Algorithm Followed. #include<stdio.h>…
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: Count positive and negative numbers and compute the average of numbers) Write a program that reads…
A: Code import java.util.Scanner; public class NumbersStats { public static void main(String[]…
Q: 1. Use if - else - elif Write a program to get an integer input from the user. If the input is 25,…
A: The problem is abput finding the area of different shapes corressponding to different inputs from…
Q: 1. Write a program that takes a two digit number and prints the number backwards.
A: As per the rules of Bartleby i can only solve 1 question at a time if they are not interrelated so…
Q: Exercise 6: Write a program which prints all the numbers between 10 and 15 which are not…
A: As you have not mentioned the coding language i am providing the code in c++: #include…
Q: (Summing Integers) Write a program that uses a for statement to sum a sequence of integers. Assume…
A: Note: Here you didn't mention any programming language so we are writing the program in the C++…
Q: (Find future dates) Write a program that prompts the user to enter an integer for today’s day of…
A: Actually, integers are like whole numbers, also included negative numbers.. but not allows floating…
Q: A palindromic number is a number that is the same when written forwards or backwards. The first few…
A: PROGRAM STRUCTURE: Take the number from the user. Declare the required variables. Start the loop to…
Q: THE LARGEST NUMBER # read two numbers number1 = int(input("Enter the first number: ")) number2 =…
A: I am providing you the python program to print the largest among three numbers and to find a leap…
Q: Armstrong numbers between two intervals Write a program to print all the Armstrong numbers in the…
A: A=int(input()) B=int(input()) flag = False for i in range(A, B+1): x = len(str(i)) sum1 =…
Q: [Question Description] Enter any number of integers with three digits and determine whether they are…
A: Below is the complete solution with explanation in detail for the given question about palindrome.…
Q: 2.21 LAB: Expression for calories burned during workout The following equation estimates the average…
A: Find the required code in java given as below and output :
Please help to
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 2 images
- 4. During each summer, John and Jessica grow vegetables in their backyard and buy seeds and fertilizer from a local nursery. The nursery carries different types of vegetable fertilizers in various bag sizes. When buying a particular fertilizer, they want to know the price of the fertilizer per pound and the cost of fertilizing per square foot. The following program prompts the user to enter the size of the fertilizer bag, in pounds, the cost of the bag, and the area, in square feet, that can be covered by the bag. The program should output the desired result. However, the program contains logic errors. Find and correct the logic errors so that the program works properly. // Logic errors. #include #include using namespace std; int main() { double costs double area; double bagsize; cout > bagsize; cout > cost; cout > area; cout << endl; cout << "The cost of the fertilizer per pound is: $" << bagsize / cost << endl; cout << "The cost of fertilizing per square foot is: $" << area / cost << endl; return 0; }17.1 LAB: Convert to seconds Write a program that reads in hours, minutes, and seconds as input, and outputs the time in seconds only. Ex: If the input is: 1 6 40 where 1 is the number of hours, 6 is the number of minutes, and 40 is the number of seconds, the output is: Seconds: 4000 344614.2153518.qx3zqy7Factorial) The factorial of a nonnegative integer n is written n! (pronounced “n factorial”) and is defined as follows:For example, 5!= 5.4.3.2.1 , which is 120. Use while statements in each of the following:A. Write a program that reads a nonnegative integer and computes and prints its factorial.B. Write a program that estimates the value of the mathematical constant e by using the formula:Prompt the user for the desired accuracy of e (i.e., the number of terms in the summation).C. Write a program that computes the value of by using the formula Prompt the user for the desired accuracy of e (i.e., thenumber of terms in the summation).
- Q5: (Count positive and negative numbers and compute the average of numbers) Write a program of C++ that reads an unspecified number of integers, determines how many positive and negative values have been read, and computes the total and average of the input values (not counting zeros). Your program ends with the input 0. Display the average as a floating-point number. Here is a sample run: Enter an integer, the input ends if it is 0: 1 2 -1 3 0 The number of positives is 3 The number of negatives is 1 The total is 5.0 The average is 1.25(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.]19.12 LAB: Convert from seconds People find it easier to read time in seconds, minutes, and hours rather than just seconds. Write a program that reads in seconds as input, and outputs the time in seconds, minutes, and hours. Ex: If the input is: 4000 the output is: Seconds: 40 Minutes: 6 Hours: 1 #include <iostream>using namespace std; int main() { int seconds; int minutes; int hours; /* Type your code here. */ return 0;}
- 1)(Calculating Credit Limits) Collecting money becomes increasingly difficult during periods of recession, so companies may tighten their credit limits to prevent their accounts receivable (money owed to them) from becoming too large. In response to a prolonged recession, one company has cut its customers’ credit limits in half. Thus, if a particular customer had a credit limit of $2000, it’s now $1000. If a customer had a credit limit of $5000, it’s now $2500. Write a program that analyzes the credit status of three customers of this company. For each customer you’re given: a) The customer’s account number. b) The customer’s credit limit before the recession. c) The customer’s current balance (i.e., the amount the customer owes the company). Your program should calculate and print the new credit limit for each customer and should determine (and print) which customers have current balances that exceed their new credit limits. 2) (Coin Tossing) Write a program that simulates coin…Q5: (Count positive and negative numbers and compute the average of numbers) Write a program that reads an unspecified number of integers, determines how many positive and negative values have been read, and computes the total and average of the input values (not counting zeros). Your program ends with the input 0. Display the average as a floating-point number. Here is a sample run: Enter an integer, the input ends if it is 0: 1 2 -1 3 0 The number of positives is 3 The number of negatives is 1 The total is 5.0 The average is 1.253. The formula for determining compound interest is: A represents the amount to earn; P is the principle that is initially invested; r is the interest rate earned; n is the number of times the interest is compounded; and t is the number of time periods for the investment. Write a program that prompts the user to enter P, r, n and t. The program should output the amount earned on the investment. 4. Look up the Pythagorean theorem if you are not already familiar with it. Use the following formula to solve for c in the formula: c = √a2 + b2. Use the proper functions from the cmath header file. Be sure to output the result.l
- Q1: Write a program that reads 10 numbers and then finds the largest number and prints it and finds the smallest number and eyPROGRAM 6: Three Zero GameWrite an HLA program that reads a number. Then by subtracting off a three and tens, determine if that value ends in a zero or a three. Three such numbers in a row wins the game! Shown below are sample program dialogues to help you build your program. Gimme a number: 20It ends in zero!Keep going...Gimme a number: 53It ends in three!Keep going...Gimme a number: 41Sorry Charlie! You lose the game!Gimme a number: 50It ends in zero!Keep going...Gimme a number: 23It ends in three!Keep going...Gimme a number: 70It ends in zero!You Win The Game! Gimme a number: 51Sorry Charlie! You lose The Game!python code Problem 5 A nutritionist who works for a fitness club helps members by evaluating their diets. As part of her evaluation, she asks members for the number of fat grams and carbohydrate grams that they consumed in a day. Then, she calculates the number of calories that result from the fat, using the following formula: calories from fat = fat grams x 9. Next, she calculates the number of calories that result from the carbohydrates, using the following formula: calories from carbs = carb grams x 4 . Write a program that will make these calculations. Your program should use two separate functions to calculate fat and carb calories. Write a 3rd function that is called from main to capture user input and call the others.