Consider the following program: int x, y; cin >> x>> y; if(x>y) x = x-y; else if(x
Q: Pakistan online Daraz company has four agent (1 to 4) who sell 5 different products ( 1 to 5). Once…
A: Write the program as follows: Create a 2D array of size 4*5. Input the sales of product for each…
Q: Q2: Write a FORTRAN90 program that reads a student ID and his GPA out of 4.0. The program should…
A: According to the asked question, the solution is given below with a proper explanation.
Q: Write a c++ program where mikayla jylana deposit her money in time deposit at a bank of Php 25000.…
A: #include<iostream> using namespace std; int main(){ float…
Q: Engineering P4.4.1.9 A mass m is attached to the end of a rope of length r= 3 meters. The rope can…
A: Required: A mass m is attached to the end of a rope of length r = 3 meters. The rope can only be…
Q: Write a program that reads the subtotal and the gratuity rate, then computes the gratuity and total.…
A: Here I have asked the user to enter subtotal and gratuity rates. Then I have calculated the gratuity…
Q: Write a program in c++ to prompt user to enter the salary and incentive.Company decides to deduct…
A: Program Approach - Use the header files and define the main function Declare the variables as per…
Q: Implement the following decision table using a nested if statement and multiple alternatives if…
A: When the grade point average value lies between 1.0-1.99 (inclusive both the values) or not. If yes…
Q: Write a program that initiates the variables cost1, cost2 and costs 3 and assigns them the values…
A: We can easily initiates the variables and assign them values in one go as: (The language here is not…
Q: A triathlon is a multiple stage sports competition, where athletes compete for fastest overall…
A: Use a loop to iterate for 50 times and accept the input and store minimum time and respective player…
Q: b) Write a full program by apply the following decision table using nested if statement. Assume that…
A: Sample Response: //C++ programming language#include <iostream>using namespace std;//main…
Q: Q3: Write a VB program to enter a mark of a student and then find his grade as follows: If mark >=75…
A: VB program is asked with the following conditions: If mark>=75 print Grade = A If…
Q: A variable in a program is a named placeholder that can contain any integer value. The statement z +…
A: Below is the complete solution with explanation of the given question. The value of each iteration…
Q: c++ program or code of Juan works on a field and for his work he receives 1/3 of the crop. If his…
A: #include<iostream>using namespace std; int main(){ float share_of_juan = 245; float part…
Q: A program calculates the total salary of an employee with the condition that if the working hours…
A: Given:
Q: A travel company has three types of buses (A, B and C), each one has a price based on the kilometer…
A: - We need to code for the bus fare problem. - We have to use C language.
Q: The table below shows the AZA Travel Tour ticketing price: Package b) c) d) Istanbul Beijing Tokyo…
A: Step 1: Start Step 2: take input of package code Step 3: validate package code if valid continue…
Q: In C++ 1. Write a program that accepts from the user an amount in Peso. It should compute the…
A: Given: The amount entered by the user in Peso. Also, 1 HK dollar = Php 6.51 1 US dollar = Php…
Q: Germany has minimum marrying law in which if any person has age greater than 18 , they can marry.…
A: Requirements:- Germany has minimum marrying law in which if any person has an age greater than 18,…
Q: Questlon Two: Write a C+ program to calculate the average of five student grades, then print "A+" if…
A: Output 1: Output 2: Output 3: Output 4:
Q: Mars hyper market gives discount to customers based on their spending. If a customer spends 20 Omani…
A: #include<iostream>using namespace std;int main(){ float spending; cin>>spending;…
Q: What is the wrong in the following programming statement? A if (age >=65); cout = 1, x++) cout <<x…
A: In question A wright program is as following if(age >=65) cout << "Age is greater than or…
Q: Write a Q. BASIC program that reads and outputs the weather status average using Nested IF…
A: I have implemented the following requirements with comments for better understanding of the code. I…
Q: Note: C++ language Write a program that determines the price of an item after discount according to…
A: PROGRAM INTRODUCTION: Include the required header files. Start the definition of the main function.…
Q: Rewrite the following expressions as C++ assignment statements that use the conditional operator.…
A: The syntax of the conditional operator is as follows: Expression1 ? Expression2 : Expression3 If…
Q: In C, the condition that will give a true statement when a number x is in the range of is 0 10 O x>0…
A:
Q: Vrite a C++ program that determines a student's grade. The program will read mid-term, and inal…
A: While(1) is infinite loop which continues until a break statement is not encountered. condition to…
Q: Write the statement in words if: p: Firemen work hard. q: Firemen wear red suspenders 3) ~p → q
A: Please refer to the following step for the complete solution of the problem above.
Q: The table below shows the Package Istanbul Beijing Tokyo b) c) d) Pavel Tour ticketing price:…
A: Code : #include<iostream>using namespace std;int main(){ double totalPrice=0;…
Q: XYZ Telegram Company charges P18.50 for a telegram that do not exceed 12 words and P1.50 for every…
A: Find the required code given as below and output:
Q: 2. Write a program that takes an amount in pesos and breaks it down to bills (1000, 500, 100, 50,…
A: Write a program that takes an amount in pesos and breaks it down to bills (1000, 500, 100, 50, 20)…
Q: A) Use (switch statement) to write a program in C++ to show company structure. I r is (A), print…
A: Here we need to use switch case on some character input. The syntax for switch case is…
Q: Fox International sells pre-paid calling card with the following features: Calls to USo 1.2 cents…
A: Java program to create the Fox International Calling Card Calculator.This program takes account…
Q: Make a flowchart where a program dispenses cash at an ATM machine that has been upgraded to dispense…
A: Since you needed the output screenshot I am attaching for both conditions thatis when amount is…
Q: Write an efficient if statement to assign x the value 1 if x ≤ 1.5, 2 if 1.5 <x < 2.5, and 3…
A: The above question is solved in step 2 and step 3 :-
Q: Write a program that computes the body mass index (BMI) of an individual. Your program should begin…
A: Note : Here I have asked for the height in inches and weight in pounds from user. Algorithm : Step…
Q: if (a > 0) if (b 5) x - x + 4; else x - x + 3; else x -x + 2; « is currently 0, a is 1 and b is -1,…
A: Here in this question we have given a Java code and we have asked to find the final value of x after…
Q: Suppose you shop for rice in two different packages. You would like to write a program of C++ to…
A: The price per unit weight can be calculated by dividing the total package price by total weight and…
Q: Write a VB program to ask user to assign a value to “i” to find the answer for the following three…
A: Dim i As IntegerDim HowMuch As IntegerHowMuch = 0For i = 1 To 10 If i < 5 Then HowMuch…
Q: Driving is expensive. Write a program with a car's miles/gallon and gas dollars/gallon (both floats)…
A: Here I have created the function named driving_cost(). In this function, I have divided the miles by…
Q: Write a C program to compute the total marks scored by a GTUC student who sat for 8 Subjects in…
A: Actually, program is a executable software that runs on a computer.
Q: Write a Q. BASIC program that reads and outputs the weather status average using Nested IF…
A: I have implemented the following requirements with comments for better understanding of the code. I…
Q: Write a C++ program whose display heading on the top as “Admissions in Iqra University” that offers…
A: PROGRAM CODE: #include <iostream> // include header file for input output…
Q: An Auto Insurance Program Example - Write a C++ program to determine the cost of an…
A: PROGRAM: //Header File #include <iostream> using namespace std; //Defining main int main() {…
Q: Q4. Write a program that calculate the person's Body Mass Index (BMI). The BMI is often used to…
A: Given: Write a program that calculates and displays a person’s body mass index (BMI). The…
Q: Create a programming flowchart: That requires computing the grade of a student through getting the…
A: Flowchart : A flowchart is a tool to represent the algorithmic steps to solve a problem in…
Q: Implement the following decision table using a nested if statement and multiple alternatives if…
A: Given:
Step by step
Solved in 2 steps
- Imagine you are working for a lumber company, and your employer would like a program that calculates the cost of lumber for a customer order. The company sells pine, fir, cedar, maple, and oak lumber. The lumber is priced by board feet. One board foot equals one square foot that is one inch thick. The price per board foot is given in the following table: Pine 0.89 Fir 1.09 Cedar 2.26 Maple 4.50 Oak 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). Create a blank c++ Give the customer instructions and then ask the user (customer) to identify the items they wish to purchase by inputting the type of wood, the length, width, & heights of the board, and the number of boards they desire. Allow the user to…In programming language C.Write a program to calculate electricity bill charged to a consumer. Ask him to enter the units consumed. For all units less than or equal to 200, each unit is to be charged at Rs. 2. If units>200 and <=400, first 200 units is to be charged at Rs. 2 and other units is charged at Rs. 4. Each unit more than 400 will be charged at Rs. 5.Python programming In a department store sale, customers who purchase over 2000 are given 10% discount. Write a program that will accept for the purchase amount of a customer, solve for his/her discount if there’s any, ask for the money he/she is going to pay, then output the discounted price and the change of the customer.”
- Show the value of x after each of the following statements is performed:a) x = fabs(7.5);b) x = floor(7.5);c) x = fabs(0.0);d) x = ceil(0.0);e) x = fabs(-6.4);f) x = ceil(-6.4);g) x = ceil(-fabs(-8 + floor(-5.5)));Assume that at some stage, foo(80, 100) is called. The function, in turn, called by foo(80, 100) is foo(Answer, Answer). public static int foo(int a, int b) { if(b == 0) return a; return foo(b, a%b);} how do I answer this (JAVA PROGRAMMING)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.
- In C++, write a program that inputs three integers from the keyboard and prints the sum, average, product, smallest and largest of these numbers. The screen dialog should appear as follows: Input three different integers: 13 27 14 Sum is 54 Average is 18 Product is 4914 Smallest is 13 Largest is 27Write a program in C language to simulate tossing a “fair” coin. Allow the user to enter the number of tosses.Print the number of tosses that yield heads and the number of tosses that yield tails.What should be the percentage distribution of heads and tails? (Use the function rand_int)In java, How can the following statement be rewritten using a conditional operator?if(x <0) y = x;else y = 0;
- In C++ , Write a program for a Bookstore to take an order from a customer, calculate how much to charge a customer based on his/her order, and display a receipt. The store sells only three books, designated by their authors: Cervantes ($41.25 each), Homer ($15.85 each), and Shakespeare ($30.50 each). Your program is to work as follows: Display a welcome message (e.g., “Welcome to the Bookstore!”) Prompt the user for his/her first name Prompt the user to input the number of books by Cervantes s/he wants Prompt the user to input the number of books by Homer s/he wants Prompt the user to input the number of books by Shakespeare s/he wants Compute the total amount due, including a 10% sales tax Display amount due Ask the user how much money s/he will pay Display a receipt listing the name of the user, the quantity of each item ordered, the total cost of the order, and the amount the user will have left after paying Execution of the compiled program should appear roughly as follows…Computer Science Write a Java program that reads a line and a line segment and then determines whether they intersect or not. When they overlap completely, consider that as intersecting. Use variables ((lp1x, lp1y), (lp2x, lp2y)) to represent a line and ((sp1x, sp1y), (sp2x, sp2y)) to represent a line segmentPython Write a program that receives a number from a user and checks if it's float or integer.In case of being float, print for the user that his/her number is float with integer part andfractional part. In case of being integer, print to the user that his/her number is aninteger and odd/even numbeR