2.12 LAB: Driving costs Driving is expensive. Write a program with a car's gas mileage (miles/gallon) and the cost of gas (dollars/gal output the gas cost for 20 miles, 75 miles, and 500 miles. Output each floating-point value with two digits after the decimal point, which can be achieved as follows: print (f' {your_value1:.2f} {your_value2:.2f} {your_value3:.2f}') Ex: If the input is: 20.0 3.1599 where the gas mileage is 20.0 miles/gallon and the cost of gas is $3.1599/gallon, the output is: 3.16 11.85 79.00 Note: Real per-mile cost would also include maintenance and depreciation
Q: A contract review can be performed by "insiders" (members of the organization's proposal team or…
A: 1. Advantages: – Outsiders assure more independence of reviews. – Outsiders may be chosen to possess…
Q: reference bandwidth is a default value on Cisco router divide the reference bandwidth by the…
A: Introduction: The reference bandwidth is a default value on Cisco routers which is a 100Mbit…
Q: List the supplier's capability issues that should be considered by the contract review team.
A: Here we have given the list of supplier's capability issues to be considered by the contract review…
Q: Problem 1: Construct a Turing Machine for language L₁= (a"be"In 21).
A: The algorithm for planning the turing machine will be: 1. Mark one 'a' to X then move right.2. Mark…
Q: Explain in your own words why big bang testing is inferior to any method of incremental testing…
A:
Q: HRS Ltd is a software house that specializes in human resource management packages sold mainly to…
A: Answer: Step1## Prototype methodology can be reccomended To penetrate into any new area, It will be…
Q: ASAP Solution needed / Solution You're given a string of words. You need to find the word "Nemo",…
A: Input - String Output - String In this problem, we need to design the code in the JS programming…
Q: Show that convolution with a given function f commutes with differentiation; that is, show that…
A: According to the question, we have to show that (f * g)' = f * g'. In step 2, we will show that…
Q: A computer user finds that his wireless router transmits data at a rate of 75 Mbps (megabits per…
A: ANSWER:
Q: Show that convolution with a given function f commutes with differentiation; that is, show that…
A: Show that convolution with a given function f commutes with differentiation that is, show that…
Q: 3. The intensity of radiation of a radioactive substance was measured at half-year intervals. The…
A: SOLUTION:
Q: Solution should be provided in js Programming / ASAP Solution needed (Ctrl) Create a function that…
A: Algorithm - Take input from user. Now use the below logic - function helper(num) { return…
Q: which of the following statement is True java regarding creation script Array Object All of these…
A: All of this
Q: A contract draft review of a properly prepared contract document is expected to yield no negative…
A:
Q: What are some of the ways that defects can be introduced, and why or why won’t a defect result in a…
A: 1. A failure is an error caught by the customer or end-users where the expected and actual behavior…
Q: You are counting points for a basketball game, given the amount of 2-pointers scored and 3-pointers…
A: Algorithm - Take input from user.Now use the below logic -return (2 * twoPointers) + (3 *…
Q: Select one of the high-profile cyberattacks from step 1a and write an analysis of the attack that…
A: A cyber-attack is any hostile move that objectives PC data frameworks, PC organizations,…
Q: Create a function which counts how many lone 1s appear in a given number. Lone means the number…
A: Input - Array Output - array In this problem, we need to design the code in the JS programming…
Q: A software development firm is planning a new airport luggage control project. The system is to…
A: Software quality assurance means the verification and validation of the software project, there are…
Q: HRS Ltd is a software house that specializes in human resource management packages sold mainly to…
A:
Q: "Police Star 1000 System" is the new prestigious software system for recording all the verbal…
A: 1) The system stores a massive amount of recordings. The task of allocating the required voice…
Q: 1. List your arguments in favor of this recommendation.
A: Software inspection is a control technique to ensure that the documentation produced in a particular…
Q: agree, list your arguments. disagree, list your contradictory arguments.
A: Testing is the basic activity aimed at detecting and solving technical issues in the software source…
Q: Create a function which counts how many lone 1s appear in a given number. Lone means the number…
A: Since the programming language is not mentioned, I have done the code using JavaScript.
Q: What type of information are text books good for obtaining
A: Introduction: Textbook: Contains data/information/knowledge Act as a knowledgebase for…
Q: What is Network Linking Devices?explain any three devices with example
A: PCs or other electronic tools can connect to network devices to exchange documents or resources like…
Q: A computer user finds that his wireless router transmits data at a rate of 75 Mbps (megabits per…
A: Average time to transmit one bit is 1.27 * 10^-8 Time taken by signal to reach the phone is 2.67 *…
Q: contain any methods to read / write the data. Only implement the following in the class. This class…
A: #include "linked_list.h" #include <iostream> using namespace std;…
Q: Which of the following models are equivalent to Turing machine (with regards to their expressive…
A: A Turing machine comprises of a limitlessness long tape, which has been split into cells. Every cell…
Q: Q4: For Figure1, explain the difference in the output if you share the object by shx=2, and scale…
A: The question is related to computer graphics.
Q: This class will contain the method necessary to read and parse the .csv file of stock information.…
A: class DateFormatException extends IllegalArgumentException { public DateFormatException(String…
Q: Create a Venn diagrams for each item to visually represent the similarities and differences between…
A: According to the question, we have to explain similarities and differences between centralized and…
Q: David Martin just finished his inspection coordinator course. After obtaining his first appointment,…
A: David Martin just finished his inspection coordinator course. After obtaining his first appointment,…
Q: Write a program that takes an integer list as input and sorts the list into descending order using…
A: BELOW ? STEP BY STEP COMPLETE SOLUTION REGARDING YOUR PROBLEM :
Q: Define a function CalcVal() that takes two integer parameters and returns the sum of the two…
A: #include <iostream>using namespace std; /* Your code goes here */ int main() { int input1,…
Q: ASAP Solution needed / Solution | Given a matrix mtx, implement a function that returns the complete…
A: Algorithm - Take input from user. Now use the below logic - const transposeMatrix = m =>…
Q: Write – 251/256 in binary using 2’s complement in 10 bits.
A: Given number is, 251/256 2's complement binary form means a number is written in the binary form and…
Q: ALPHABET SOUP PROBLEM: Create a function that takes a string and returns a string with its letters n…
A: As per the given question, we need to create a function named alphabet_soup() that returns a string…
Q: Write a C++ program that : You have to do the following question only by nested if-statement. FROM…
A: Write a C++ program that : FROM GRADE A TO F A 93-100% A- 90-92% B+ 87-89% B 83-86% B- 80-82%…
Q: In Chefland there is a competition with N participants (numbered 1 to N). There are N-1N-1 rounds in…
A: Input-Output Details: The first line of input contains a single integer T indicating the number of…
Q: ASAP Solution needed / Solution You're given a string of words. You need to find the word "Nemo",…
A: SOLUTION:
Q: In Chefland there is a competition with N participants (numbered 1 to N). There are N-IN-1 rounds in…
A: Algorithm: The first line of the input contains a single integer TT denoting the number of test…
Q: Q2) Write a program that prompts the user to input two integers: First Integer and SecondInteger…
A: Step-1: StartStep-2: Declare variables FirstInteger, SecondInteger and take inputs from userStep-3:…
Q: Write a function that takes in an array of integers and returns the integers that are either…
A: Algorithm - Take input from user. Now use the below logic - nums.map(function(el){…
Q: Add binary numbers 100111 and 11011 in both decimal and binary forms.
A: We need to add binary numbers 100111 and 11011 in both decimal and binary forms.
Q: One can expect that in many cases, participants in an inspection session are able to suggest…
A: The question is to state the reason for the given statement.
Q: software development rm is planning a new airport luggage cont project. The system is to control…
A: a) This project should be implemented using Agile methodology. Due to the need to develop many…
Q: List the partner and subcontractor participation issues that should be considered by the contract…
A:
Q: "Bengal Tours" is a city center travel agency that specializes in tours and vacations in Canada. The…
A: The travel agency’s staff is expected to use the Tourplanex software package hundreds of times a day…
Q: 1: Rasterize a circle with center (150,100) and radius length equal to 5, then draw a complete…
A: with regard to it regarding to it, A circle with a center of (150 100) and a circle radius of 5. We…
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 2 images
- Activity 2 7.) Write a program that will calculate and print out bills for the city water company. The water rates vary depending on whether the water is for home use, commercial use or industrial use. A code of H means home use, a code of c means commercial use and a code of I means industrial use. The water rates are computed as follows: code H: P250.00 plus P0.002 per gallon used code c: P5,000.00 for the first 4 million gallons and P0.002 for each additional gallon. code I: P8,000 if usage does not exceed 4 million gallons, P14,000 if usage is more than 4 million gallons but not more than 10 million gallons and P18000 if usage exceeds 10 million gallons. Your program should prompt the user for the code and the gallons of water used. Your program should echo your input data and should print the amount due from the user. Your program should use a switch statement for the code (char data type). Use the float data type for the gallons. Sample Output in the images:In C++ 2.12 LAB: Hypotenuse Given two numbers that represent the lengths of a right triangle's legs (sides adjacent to the right angle), output the length of the third side (i.e. hypotenuse) with two digits after the decimal point. Output each floating-point value with two digits after the decimal point, which can be achieved by executingcout << fixed << setprecision(2); once before all other cout statements. Ex: If the input is: 3.0 4.0 the output is: Hypotenuse: 5.00I have an assignment that needs to be turn in before monday, here's the question: Two people play the game of Count 21 by taking turns entering a 1, 2, or 3, which is added to a running total. The player who adds the value that makes the total reach or exceed 21 loses the game. Create a game of Count 21 in which a player competes against the computer, and program a strategy that always allows the computer to win. On any turn, if the player enters a value other than 1, 2, or 3, force the player to reenter the value. Save the game as Count21.java. Here's the code that I'm working on: import java.util.Scanner;public class Count21 {public static void main(String[] args) {// Scanner object to get user inputScanner scanner = new Scanner(System.in);// Stores the running total. //Displays a welcome for the user public void promptEnterKey(){System.out.println("Welcome to Count21! \n");System.out.println("Press \"ENTER\" to continue...");Scanner scanner = new…
- 1. Implement function postal() that takes 6 inputs: a first name (as a string) a last name (as a string) an address (as a string) a city (as a string) a state (as a string) a zip code (as an integer)and then prints a mailing address in 3 lines as shown below.>>> postal('Ljubomir', 'Perkovic', '243 S Wabash Ave','Chicago', 'IL', 60304)Ljubomir Perkovic243 S Wabash AveChicago, IL 603043.19 In Java Write a program with total change amount in pennies as an integer input, and output the change using the fewest coins, one coin type per line. The coin types are Dollars, Quarters, Dimes, Nickels, and Pennies. Use singular and plural coin names as appropriate, like 1 Penny vs. 2 Pennies. Ex: If the input is: 0 the output is: No change Ex: If the input is: 45 the output is: 1 Quarter 2 DimesWRITE CODE IN C LANGUANGE On their way down the river, Jojo and Lili saw two frogs each in position X1 and X2. The two frogs are seen jumping happily towards the same direction that is come to Jojo. After watching the two frogs, Joio and Lili saw that the speed the two frogs are different. The first frog to start jumping from position X1 has a speed of v1, while the second frog that starts to jump from position X2 has a speed of V2. Joig guess that "YES" both frogs will be in the same position in a certain time T, while Bibi guessing "NO" the two frogs will never be in the same position in time. Help Joio and Lili calculate the frog's movements to determine whether the guess they are right
- C++ Write a program that simulates the minute-by-minute operation of a checkout line, such as one you might find in a retail store. Use the following parameters: Customers arrive at the checkout line and stand in line until the cashier is free. When they reach the front of the line, they occupy the cashier for some period of time (referred to as ServiceTime) measured in minutes. After the cashier is free, the next customer is served immediately. Customers arrive at the checkout line at ArrivalRate per minute. Use the function included below (customerArrived()) to return the number of customers arriving in a given minute, determined randomly. The line can only hold so many people, MaxLineSize, until new arriving customers get frustrated and leave the store without purchasing anything. The overall time of the simulation is SimulationTime, measured in minutes. The program should take 5 inputs (to be read from a text file named simtest.txt, one per line): SimulationName - a string…Let's modify the program from this section so that the user can supply the interest rate. For very small interest rates, it may take a very long time for the balance to double. Assume the user can't wait for more than twenty years. Stop adding interest when the balance has doubled or twenty years have elapsed. 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 finaldoubleTARGET=2*INITIAL_BALANCE; doublebalance=INITIAL_BALANCE; intyear=0; Scannerin=newScanner(System.in); System.out.print("Interest rate in percent: "); doublerate=in.nextDouble(); // TODO: Count the years required for the investment to double // but no more than 20 years /* Your code goes here */ System.out.println("Year: "+year); System.out.printf("Balance: %.2f%n", balance); }Write a program in python that prints a pyramid made of letters in the middle of the screen. Use functions with parameters for this assignment. The base width of the pyramid is determined by a character the user enters. If the user enters the letter o, the following pyramid will be printed. It can be assumed that the screen width is 80 characters. a aba abcba abcdcba abcdedcba abcdefedcba abcdefgfedcba abcdefghgfedcba…
- When you use a mortgage to purchase a home, the lending institution effectively owns the home. You buy back part ownership in the home with each monthly payment. The part you have bought back is your equity in the home. If the mortgage amount is P dollars, the monthly interest rate is r as a decimal, and the term of the mortgage is t months, then your equity after k payments is E(k) = P((1 + r)k − 1) (1 + r)t − 1 dollars. In this exercise, assume that the mortgage amount is $200,000, the APR is 6% so r = .06/12 and the term of the loan is 30 years (360 months). (a) Find a formula for the equity. (b) Make a graph of the equity over 360 months, the term of the loan. (c) Does the graph show that you have half-ownership in the home halfway through the term of the mortgage? Halfway through the term of the mortgage corresponds to k1 = _______ payments. From the graph, we see that E(k1) is ________ half of the mortgage amount, so we _______ have half-ownership in the home…You are working for a lumber company, and your employer would like a program that calculates the 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: Pine 0.89Fir 1.09Cedar 2.26Maple 4.50Oak 3.10 The lumber is sold in different dimensions (specified in inches of width and height, and feet of length) that need to be converted to board feet. For example, a 2 x 4 x 8 piece is 2 inches wide, 4 inches high, and 8 feet long, and is equivalent to 5.333 board feet (2 * 4 * 8 = 64, which when divided by 12 = 5.333 board feet). An entry from the user will be in the form of a letter and four integer numbers. The integers are the number of pieces, width, height, and length. The letter will be one of P, F, C, M, O (corresponding to the five kinds of wood) or T, meaning total. When the letter is T, there are no…Write a program in C++ with total change amount as an integer input that outputs the change using the fewest coins, one coin type per line. The coin types are dollars, quarters, dimes, nickels, and pennies. Use singular and plural coin names as appropriate, like 1 penny vs. 2 pennies. Ex: If the input is: 0 or less, the output is: no change Ex: If the input is: 45 the output is: 1 quarter 2 dimes Your program must define and call the following function.void ExactChange(double userTotal, int& numDollars, int& numQuarters, int& numDimes, int& numNickels, int& numPennies) *C++