Write a program that will obtain the following integer values from the user: - the date broken down into month, day and year (3 variables). The current meter reading, the previous meter reading. Calculate ar electric bill based on the following rate & consumption table: Kilowatt Consumption Cost 0 - 400 KWH a flat rate of $8.50 $8.50 (base rate) + 7.525 cents for each KWH over 400 (May – Sept.) or 6.575 cents for each KWH over 400 (all othe months) calculate the first 1200 KWH according to the formula given above plus 95% of the appropriate seasonal rate for the KWH over 1200 401 – 1200 KWH over 1200 KWH
Q: C++ SIMPLE CODE
A: Code: #include <iostream>using namespace std;//function to find the nearest prie int…
Q: program lo check a given array of integers and return true if there is a 3 with a 5 somenhere later…
A: we have to make a c++ program to check if an array of integers has 3 and somewhere also has 5 in it.
Q: You were hired by PAGCOR as part of programming team in-charge of automating its BINGO game. Your…
A: Step 1: Accept Number n form user Step 2: if Number between 1 to 15 the print "That's Letter 'B' in…
Q: Explain and differentiate between while and do while statement in 'C++' language.
A: Introduction In this question we will explain and differentiate between while and do while statement…
Q: Write a program which gives a menu to the user to select one from two choices. Z to find your Zodiac…
A: (1) First we need to read the month and day (2)Then determine and print the sign as per given…
Q: Problem E. Minimum Input file: Output file: Time limit: standard input standard output 2 seconds…
A: Input : Input array size Input array elements Input k number Output : Output kth minimum element
Q: Problem H. Search Input file: Output file: Time limit: standard input standard output 2 seconds…
A: Code: #include<iostream>using namespace std; int main(){ //declaring required variables…
Q: 1. The input integer, n Constraints The value is >= 1 Output The first line will contain a message…
A: Algorithm: Include standard header file and namespace std. Create a main function Declare the…
Q: Write a program that will display "IT'S COLD!" if the temperature is less than 20, "IT'S HOI" if the…
A: #include <iostream> using namespace std; int main(){ float t; cout<<"Computing the…
Q: 1. Develop the required system and use lastname_3rdE.cpp for the file name 2. Remember that both n…
A: In this question, we have to write a program, in that program, if the user enters the value 1 then…
Q: C++ Problem 1 please
A: Given We know about the C++ programing.
Q: C++ basic definitions
A: C++ is an object-oriented computer language created by notable computer scientist Bjorne Stroustrup…
Q: Pls help me to write a c++ program
A: ANSWER:-
Q: Problem J. Trimmer2 Input file: Output file: standard input standard output 2 seconds Time limit:…
A: #include <bits/stdc++.h>using namespace std; string removeOdd(string str){ string new_string…
Q: write C++ program
A: Task: to create a c++ program
Q: C++ Demonstration #1: C++ Class Implementation and Objects in Stack Memory Given the class diagram…
A: In this program we have to create a class of C++ where we have a Circle class with some common…
Q: Write a program that will draw a reversed triangle. Your program will ask for the height of the…
A: Task :- Write a C++ program to print the pattern. C++ program :- #include<iostream>using…
Q: eate a scientific c++ calculator program which have different functions for different operations.…
A: C++ code :- #include <iostream>#include <cmath> using namespace std; void…
Q: (Inactive C:\TCWIN\BIN\NONAMEO0. EXE) Enter a number between 1 and 9 >-1 Sorry your number is not…
A: Programming instructions: Include necessary header files. In the main, declare required…
Q: The local pet store has 35 different bowls with fish in them arranged in a circle in the “fish…
A: Complete answer is given below .
Q: You are required to write a C++ program to do the following: Ask the user to enter the length and…
A: #include<iostream>using namespace std;int main(){ int r,c; cout<<"Enter the length…
Q: Looping statements in detail In c ++
A: Introduction of Looping Statement: In the programming language, Loops are used as an iterative…
Q: COMPLEX DATA TYPE (C++) Code a struct to implement the complex data type Car: 1. Data Members Name…
A: The C++ code has the following requirements:Two files - Car.h and Car.cppCar.h contains - class Car…
Q: You are given an even number N and an integer K and you have to find the greatest odd number M less…
A: #include<iostream> using namespace std; int findM(int n, int k)…
Q: Muscat marketing research company is conducting a rating survey of different chains of supermark The…
A: #include<iostream>#include<conio.h>#include<fstream>#include<string>#include…
Q: Generate the following "pyramid" of digit by using nested loops and develop a formula to generate…
A: #include <iostream>using namespace std; int main(){ int rows, count = 0, count1 = 0, k = 0;…
Q: Program a void function that asks for: (All line codes should have a comment) C++ Program -DC…
A: Algorithm: Step 1: In main method declare the volt, type as integer variable and floaat variable as…
Q: Write a program that gives a discount of 100 pesos to a customer if the shirt bought is XL and the…
A: Take input from user for size and prize Than using conditional if statements check the prize and…
Q: Write a function named BusStatistical(), that takes as parameter a two-dimensional array named bus…
A: Source code: #include <stdio.h> #include<iostream> using namespace std; int main() {…
Q: Write a program to determine the equivalent grade of each student in class as follows: a. Read in…
A: Sample output
Q: Control statement in c++
A: Control statements are how programmers indicate which section of code to use at specific times. Lets…
Q: The function is given a map with 1 representing land, o representing water. A land cell can have…
A: Program Approach : Initialize variables: We start by initializing variables that we will need…
Q: Using the below grammar, > = > A | B | c > - | / | |() | Show a complete leftmost…
A:
Q: Write a program that gives the user the choice of computing of the follOwing; the area of a circie,…
A: #include<iostream>#include<math.h> using namespace std;int main(){float a, b, h, rad,…
Problem 21 - Conditional Statements
C++
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 2 images
- python cant be the samePYTHON QUESTION : The Syracuse sequence of an integer N is the sequence of integers starting with the term N, where each following term is half of the preceding term if it is even, and one plus three times the preceding term if it is odd. The sequence ends when it reaches the integer 1. The maximum of the Syracuse sequence of an integer N is the highest number reached by this sequence. This maximum can sometimes be very high compared to the starting integer N. What is the maximum of the Syracuse sequence of 3428767? To answer this question it is useful to modify the code given in demonstration which calculates the Syracuse sequence. The code given in the demo : n = 27 print(n) while n != 1: if n%2 == 0: n = n // 2 # where n //= 2 or n >>= 1 else: n = 1 + 3*n print(n)Topic: M04 Engage X Ivy Tech Communi X MSN | Outlook, Of X O Welcome to Ivy Te I MSN | Outlook, Of X X M Inbox - staher@iv X M It's official. Your pa -> + X ivylearn.ivytech.edu/courses/969921/discussion_topics/3956672?module_item_id%3D26135882 Mometrix.com For this discussion board address the following: • Make an initial post. o Discuss tables, charts and graphs. Define and describe tables, charts and graphs, explaining when it is most appropriate to use each. o Discuss the problem. Review the problem on page 178 in the Prelude to Programming book, Programming Challenge #4. Imagine you've successfully created the program and you'd like to give Shannon and Jasmine a demonstration of your program. Shannon and Jasmine each give you a sheet of paper with their individual scores for you to input to your program. - Based on the videos and readings above, what method of data representation would they use to record their scores? Why is that the best method for the girls to record their data?…
- You are working for a lumber company, and your employer would like a program that calculatesthe cost of lumber for an order. The company sells pine, fir, cedar, maple, and oak lumber.Lumber is priced by board feet. One board foot equals one square foot that is one inch thick. Theprice per board foot is given in the following table: (image 1) The lumber is sold in different dimensions (specified in inches of width and height, and feet oflength) that need to be converted to board feet. For example, a 2 x 4 x 8 piece is 2 inches wide, 4inches high, and 8 feet long, and is equivalent to 5.333 board feet (2 * 4 * 8 = 64, which whendivided by 12 = 5.333 board feet). An entry from the user will be in the form of a letter and fourinteger numbers. The integers are the number of pieces, width, height, and length. The letter willbe one of P, F, C, M, O (corresponding to the five kinds of wood) or T, meaning total. When theletter is T, there are no integers following it on the line. The program…Write a C++ program that computes the rental fees of N cars; N is the first input by the user. For each car the user should input the car category and the number of rental days. Note that an 11% VAT tax is added to the car rental fees. At the end the program should output the following information: The daily income (the sum of all the cars rental fees). The percentage of clients who rented cars for more than 10 days.Write a program that computes the molecular weight of a carbohydrate (ingrams per mole) based on the number of hydrogen, carbon, and oxygenatoms in the molecule. The program should prompt the user to enter thenumber of hydrogen atoms, the number of carbon atoms, and the numberof oxygen atoms. The program then prints the total combined molecularweight of all the atoms based on these individual atom weights:Atom Weight(grams I mole)H 1.00794c 12.01070 15.9994For example, the molecular weight of water (H20) is: 2(1.00794) +15.9994 = 18.01528.
- When you borrow money to buy a house, a car, or for some other purpose, you repay the loan by making periodic payments over a certain period of time. Of course, the lending company will charge interest on the loan. Every periodic payment consists of the interest on the loan and the payment toward the principal amount. To be specific, suppose that you borrow $1,000 at an interest rate of 7.2% per year and the payments are monthly. Suppose that your monthly payment is $25. Now, the interest is 7.2% per year and the payments are monthly, so the interest rate per month is 7.2/12 = 0.6%. The first months interest on $1,000 is 1000 0.006 = 6. Because the payment is $25 and the interest for the first month is $6, the payment toward the principal amount is 25 6 = 19. This means after making the first payment, the loan amount is 1,000 19 = 981. For the second payment, the interest is calculated on $981. So the interest for the second month is 981 0.006 = 5.886, that is, approximately $5.89. This implies that the payment toward the principal is 25 5.89 = 19.11 and the remaining balance after the second payment is 981 19.11 = 961.89. This process is repeated until the loan is paid. Write a program that accepts as input the loan amount, the interest rate per year, and the monthly payment. (Enter the interest rate as a percentage. For example, if the interest rate is 7.2% per year, then enter 7.2.) The program then outputs the number of months it would take to repay the loan. (Note that if the monthly payment is less than the first months interest, then after each payment, the loan amount will increase. In this case, the program must warn the borrower that the monthly payment is too low, and with this monthly payment, the loan amount could not be repaid.)Write a program to calculate the position of a projectile at a given time t. For an initial velocity vo and angle of departure ®g, the position is given by x and y coordinates as follows (note: the gravity constant g is 9.81 m/s²): X= V0 Cos (0)t y=vo sin (8,)t –; gt The program should initialize the variables for the initial velocity, time, and angle of departure. It should then call a function to find the x and y coordinates, and then another function to print the resultsIn Python using the Pandas Module: Find the Player with the Highest Batting Average from 2019, only if their number of plate appearances (PA) >= 250. Plate Appearances (Pl_App), calculated as: Pl_App = HBP + SH + SF + AB + BB + Batting Average (B_AVG) is the ratio of Hits to at Bats. So B_AVG = H / AB, and is reported to three decimal points. Show code and output to prove functionality. Below is 3 years of player data: player year team lg G AB R H HR BB SO IBB HBP SH SF Alan J. 2020 NYA AL 2 0 0 0 0 0 0 0 0 0 0 Barry B. 2020 HOU AL 4 0 0 0 0 0 0 0 0 0 0 Michael J. 2020 CHA AL 60 240 43 76 19 18 59 1 3 0 1 Jim R. 2020 ATL NL 46 160 46 40 14 38 60 2 4 0 0 Nolan R. 2020 TBA AL 54 185 29 48 8 20 74 0 0 0 0 Sammy S. 2020 CHN NL 13 0 0 0 0 0 0 0 0 0 0 Frank T. 2020 SDN NL 3 1 0 0 0 0 1 0 0 0 0 Alan J. 2019 KCA AL 6 0 0 0 0 0 0 0 0 0 0 Barry B. 2019 ATL NL 16 49 4 9 2 2 18 0 0 0 0 Michael J. 2019 LAA AL 38 124 9 20 3 7 55 0 1 0 0 Jim R. 2019 MIN AL 44 89 10 17 0…
- The quadratic formula is used to solve a very specific type of equation, called aquadratic equation. These equations are usually written in the following form:ax2 + bx + c = 0The Quadratic Formula x = ( -b ± √( b^2 - 4ac ) ) / ( 2a ) Where a, b, and c are constants with a ≠ 0. (If a = 0, the equation is a linear equation.)The discriminant is the part of the formula in the square root. If the value of the discriminant is zero then the equation has a single real root. If the value of thediscriminant is positive then the equation has two real roots. If the value of thediscriminant is negative, then the equation has two complex roots.Write a program that finds the roots of the quadratic equation using the Quadratic Formula. Write a function named discriminant in the file, Disc.py, to calculate and return the discriminant of the formula. Let the main function call the discriminant function and then calculate the solution(s) of the equation. Do not calculate the solutions in the discriminant…The great circle distance is the distance between two points on the surface of a sphere. Let (x1, y1) and (x2, y2) be the geographical latitude and longitude of two points. The great circle distance between the two points can be computed using the following formula: d = radius * arccos(sin(x 1) * sin(x 2) + cos(x 1) * cos(x 2) * cos(y1 - y2)) Write a program that prompts the user to enter the latitude and longitude of two points on the earth in degrees and displays its great circle distance. The average earth radius is 6,371.01 km. Note that you need to convert the degrees into radians using the math.radians function since the Python trigonometric functions use radians. The latitude and longitude degrees in the formula are for north and west. Use negative to indicate south and east degrees.Scenario As you surely know, due to some astronomical reasons, years may be leap or common. The former are 366 days long, while the latter are 365 days long. Since the introduction of the Gregorian calendar (in 1582), the following rule is used to determine the kind of year: if the year number isn't divisible by four, it's a common year, otherwise, if the year number isn't divisible by 100, it's a leap year. otherwise, if the year number isn't divisible by 400, it's a common year. otherwise, it's a leap year. none of the above year int(input("enter the year")) if (year%4 1-0) and (year%400 -0) or (year % 1000): print (year is common year") else: print(year, is leap year") year= int(input ("enter the year")) if (years !-0) or (year480 1-0) and (year % 1001-0): print(year is common year") else: print(year, "is leap year") D year= int(input("enter the year"))