2). In a garden party there seems to beautiful decoration using daffodil bulbs and tulip bulbs. Each daffodil bulb cost OMR 2.5 and each of the tulip bulb cost is square of the cost of each daffodil bulb. Imagine, you would like to host a party with certain number of daffodil and tulip bulbs decoration. Write a C program to read the number of daffodil bulbs and the tulip bulbs you wish to have in your party, and output the total cost of the decoration using these bulbs using appropriate mathematical function. Create necessary variables and initialize variable as per the given data.
Q: write a program in C++ that Mr. Ali has invested an amount of Rs101, 876 in a Bank scheme. Bank…
A: Introduction of the Program: The C++ program calculates the total amount after 7 years using the…
Q: Q1| Write a C++ program to estimate the student's grade of 7 Courses, by following the conditions…
A: Program code: #include <iostream> using namespace std; struct student { int sub; }…
Q: Use the above functions to write a C++ program for solving each of the following computational…
A: #include <iostream>#include <chrono>using namespace std::chrono;using namespace std;…
Q: 1. Create a flowchart and C++ program of the following problem: The manager of a football stadium…
A: To construct above program , we have taken number of ticket sold of type premium as to be np number…
Q: Write a C++ program to determine whether a year entered through the keyboard is a leap year or not.…
A: There is a various approach to the problem. We can either use functions for each parameter (i.e.,)…
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: 2. Write a C++ program to compute the average thrust of a rocket motor. Program should read weight…
A: Hey there, I am writing the required solution based on the above given question. Please do find the…
Q: use c code to develop a program that gets prices of a bottled water in 12 different cities of Canada…
A: PROGRAM EXPLANATION: - The arr for prices of type double is declared of size 12. The function…
Q: Alexa has n candies and m number of students in her class. Write a C++ program to input the number…
A: Write a C++ program to input the number of candies and the number of students from Alexa and print…
Q: Kirana Hospital needs a program to compute and print a bill statement for each patient. The charges…
A: Program: #include <iostream>using namespace std;int main() { int n; char…
Q: iv) Write a C++ program to input the three dimensions(in ft) of a cuboid-shaped room from the user…
A: The total surface area is painted and the two sides has to be printed The total surface area of a…
Q: Write a program c++ to calculate the value of purchases of a specific product. The value of one…
A: Given: Write a program c++ to calculate the value of purchases of a specific product. The value of…
Q: Write a complete C program for the following problem situation. Calculate the mass of air in an…
A: Given formula is PV= 0.37 m (T+ 460) To find mass m PV0.37= m (T+ 460) m = PV0.37(T+460) C code:…
Q: Question 1 Write a C++ program that inputs the price of a shoe in a shop, then deducts the discount…
A: To find the discount amount, if-else statement can be used. Foe different amount use the respective…
Q: Write a C/C++ program that calculates and prints the bill for a cellular telephone company (say ABC…
A: Code written in c++ language for the given problem as follows- #include <iostream> // header…
Q: Question 2: Ali gives pocket money to his son in following fashion. Whatever pocket money is given…
A: Include the required libraries in the program. Declare the main function. Declare the variables of…
Q: Write a c++ program to compute and display a person's weekly salary as determined by the following…
A: Sample Response: //C++ program to calculate and print the weekly salary by using function#include…
Q: Write a c++ program to compute and display a person's weekly salary as determined by the following…
A: Given:
Q: Jeff Bezos is appearing in annual Mathematics competition and he is provided with two numbers one is…
A: According to the above listed problem statement we have to develop a C++ code to find the number of…
Q: Q11 Write a C++ program to estimate the student's grade of 7 Courses, by following the conditions…
A: Basically, the grades of a student in 7 courses are taken and if is checked if the grades are valid…
Q: Write a C++ program Eagle Parts runs a small factory and employs workers who are paid one of three…
A: c++ code: #include <iostream>using namespace std;int main(){ float…
Q: 1. Create a flowchart and C++ program of the following problem: The manager of a football stadium…
A: #include <iostream> using namespace std; int main(){ int pr,b,s,ga;…
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: Write a C++ program to calculate and display the midpoint coordinates of the line connecting the two…
A: Answer c. Given coordinates, x1 = 3 y1 = 7 x2 = 8 y2 = 12 Formula to calculate midpoint of ( x1, x2…
Q: Make a C programming and flowchart of the following: A student wants to find out his final grade.…
A: The question mentions that there are three quizzes worth 10 points each, a midterm worth 100 points…
Q: Write a c# program to calculate and print the bill of a given customer. [2] The customer id., name…
A: C# CODE: using System;class HelloWorld { static void Main() { //taking input…
Q: 39. Write a program for the following problem. An instructor needs a program that accepts a student…
A: Given : semester average grade 90 -100 A 80-89 B 70-79…
Q: 2. Write a C++ program to compute the average thrust of a rocket motor. Program should read weight…
A: Answer#include <iostream> using namespace std; //function for calculating force double…
Q: Write a C program that will read your yearly gross wage from a keyboard, calculate and display your…
A: PROGRAM CODE: #include <stdio.h> // include header file for standard input output…
Q: Write a C- program that will calculate and print out bills for the city water company. The water…
A: Write a C- program that will calculate and print out bills for the city water company. The water…
Q: 011 Write a C++ program to estimate the student's grade of 7 Courses, by following the conditions…
A: Note: Since you have asked multiple questions, we will solve the first question for you. If you want…
Q: 2). In a garden party there seems to beautiful decoration using daffodil bulbs and tulip bulbs. Each…
A: Program Explanation: Include the header file <stdio.h>. Declare the “Main” Declare the…
Q: A golf ball is dropped from an airplane. The distance, d, the ball falls in t seconds is given by…
A: totDistance = 0.5*Gravity*time*time; distance = totDistance - distance;
Q: 2). In a garden party there seems to beautiful decoration using daffodil bulbs and tulip bulbs. Each…
A: Programming instructions: Include necessary header files. Declare and initialize the required…
Q: Write a c program that display the water invoice price on the screen as follows, according to the…
A: Program code: // Include necessary header files #include <stdio.h> // Define a main function…
Q: A person X wants to distribute the property share to his children and the wife. Write a C+ program…
A: We need to take input from a user of the below things - total property worth in PKR number of sons…
Q: ) You are required to produce a C++ program which solves the following: 1- A worker is paid…
A: Note: “Since you have asked multiple questions, we will solve the first question for you. If you…
Q: You are required to produce a C++ program which solves the following: 1-A worker is paid according…
A: Code #include <iostream>using namespace std;int main(){ string name; //for input user…
Q: top of the tank to the surface of the oil. Knowing this distance and the radius of the tank, the…
A: Code: #include <iostream>#include<cmath>using namespace std; int main() {…
Q: Write a C program that will calculate the total payment for a brand new car being purchased on…
A: C program: C is a programming language developed by Dennis Ritchie at AT & T Bell Laboratory in…
Q: It is the olive oil extraction (ac) season. Farmers collect the olive from the trees and fill them…
A: C++ program :- #include <iostream> using namespace std; int main() { char type; int…
Q: Using c++ write a program A certain grade of steel is graded according to the following condition:…
A: #include <iostream>#include <cmath>#include <iomanip>#include<string>using…
Q: One large chemical company pays its salespeople on a commission basis. The salespeople receive $200…
A: 1. Sales.h //class Sales class Sales { private: //data memeber double grossSales; public: //member…
Q: Write a C program to simulate tossing a “fair” coin. Allow the user to enter the number of tosses.…
A: #include<stdio.h> #include<stdlib.h> #include<time.h> int main(){ double…
Q: Write a C program that takes as input marks of five subjects MOD2A, ETN2A, Physics 2A, Calculus 2A,…
A: Read the marks Calculate the percentage Check the grade Print all details
Q: A person X wants to distribute the property share to his children and the wife. Write a C++ program…
A: #include <iostream>using namespace std; int main() { float…
Q: This is the formula for the standard normal deviate, z, used in statistical applications: z = (X-…
A: a. The standard normal deviation needs to be calculated. Hence, there will be only one output i.e.,…
Q: B) R1= 20, R2=40 resistors are connected in series and R3-120, R4=40 resistors are connected in…
A: First of all we would derive some formulas to use in our C++ code, We have to find Currents…
Q: Write a program that will calculate and print bills for the city power company. The rates vary…
A: The C++ program with the given description will be created as follows: Declare int variables for ID…
C++
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images
- You and your friends decided to hold a “Secret Santa” gift exchange, where each person buys a gift for someone else. To see how this whole thing works, let’s consider the following example. Suppose there are 7 people A, B, C, D, E, F, and G. We denote x → y to mean “x gives a gift to y.” If the gift exchange starts with person A, then they give a gift to E. Then E gives a gift to B. And it is entirely possible that B gives a gift to A; in such a case we have completed a “cycle.” In case a cycle occurs, the gift exchange resumes with another person that hasn’t given their gift yet. If the gift exchange resumes with person D, then they give a gift to G. Then G gives a gift to F. Then F gives a gift to C. Then finally C gives a gift to D, which completes another cycle. Since all of the people have given their gifts, the giftexchange is done, otherwise the gift exchange resumes again with another person. All in all, there are two cycles that occurred during the gift exchange: A → E → B → A…Suppose we have a nice young couple who borrow $700000 from the bank, at an annual interest rate of3.124%. The mortgage is a 30 year loan, so they need to pay it off within 360 months total. Our happycouple decide to set their monthly mortgage payment at $2000 per month. Will they pay off the loan intime or not?Note that the monthly balance will be calculated asbalance = (im × previous balance) - monthly paymentwhere the convert annual interest to a monthly multiplier im is calculated as im = (1 +i)1/12 and i = annualinterest rate.Write a loop for track the total payment in 360 months so that we can evaluate if the couple can pay off theloan. Write in R Please and thank you.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…
- Suppose you want to deposit a certain amount of money into a savings account with a fixed annual interest rate. We are interested in calculating the amount needed to deposit in order to have, for instance, $5000 in the account after three years. The initial deposit amount can be obtained using the following formula: ????????????????????= ????????????????e/(1+????ℎ??????????????)????????????ℎ?To cut an 'n' centimeter-long gold bar into 2 pieces costs $n. When a gold bar is cut into many pieces, the order in which the cuts occur can affect the total amount of costs. For example, to cut a 20 centimeter gold bar at length marks 2, 8, and 10 (numbering the length marks in ascending order from the left-hand end, starting from 1). If the cuts to occur in left-to-right order, then the first cut costs $20, the second cut costs $18 (cutting the remaining 18 centimeter bar at originally length mark 8), and the third cut costs $12, totaling $50. If the cuts to occur in right-to-left order, however, then the first cut costs $20 time, the second cut costs $10, and the third cut costs $8, totaling $38. In yet another order, the first cut is at 8 (costing $20), then the 2nd cut is at 2 (costing $8), and finally the third cut is at 10 (costing $12), for a total cost of $40. Given an 'n' centimeter-long gold bar G and an array C[1..m] containing the cutting points in ascending order): a.…A proposition Q follows from a proposition P, if Q is never false when P is true. Suppose we want to check this in a particular case. Which of the following is correct? Select one: a. We need to check that whenever P is false, Q is also false. b. We need to check that whenever Q is false, P is also false. c. We need to check that whenever Q is true, P is also true. d. We need to check that Q is true when P is true, and that Q is false when P is false.
- May you please solve quick within 20-40 minutes ? There are two types of personnel working in a government office, workers and civil servants. The salary of the worker personnel is calculated by multiplying the number of days worked and the daily wage, and the salary of the civil servant personnel is calculated by multiplying the title score (0-1000), the score he will get according to the language level (100 if A is entered, 80 if B is entered, 60 if C is entered, the rest is 0) by 30. Write the C program, in which the personnel type can be entered as upper or lower case letters as W(Worker), O(Officer) and which calculates the wage to be paid to the person according to the values that are the basis for the calculation, and displays it on the screen. Also it is required that, to check the employee type you need define checkEmployee function. To calculate the title score you need to define checkTitleScore function. And finally to get the language level you need to define…[Medium] Suppose, you have been given a non-negative integer which is the height of a ‘house of cards’. To build such a house you at-least require 8 cards. To increase the level (or height) of that house, you would require four sides and a base for each level. Therefore, for the top level, you would require 8 cards and for each of the rest of the levels below you would require 5 extra cards. If you were asked to build level one only, you would require just 8 cards. Of course, the input can be zero; in that case, you do not build a house at all. Complete the recursive method below to calculate the number of cards required to build a ‘house of cards’ of specific height given by the parameter. public int hocBuilder (int height){ // TO DO } OR def hocBuilder(height):4.2) (L4) Give truth values for the propositional variables that cause the two expressions to have different truth values. For example, given p ∨ q and p ⊕ q, the correct answer would be p = q = T, because when p and q are both true, p ∨ q is true but p ⊕ q is false. Note that there may be more than one correct answer. r ∧ (p ∨ q) (r ∧ p) ∨ q
- We have n glasses which can hold a varying amount of liquid. We will say that glass1 is size q1 quarts and glass2 is size q2 quarts, etc. We now give you a size, say x quarts. You must give me a glass of exactly x quarts. You are allowed to fill any glass to exactly its size and to pour any liquid from one glass into another. When you pour, you either have to empty the glass you are pouring from or fill the glass you are pouring into. Can you do it?More concrete example: G1 has size 10 quarts. G2 has size 4 quarts. G3 has size 1 quart. You can get a 5 quart drink by filling G1, pouring 4 quarts from it into G2 and 1 quart of it into G1. After that, G1 has exactly 5 quarts. In the same problem, we could get 8 quarts by filling G2 twice and emptying it into G1 twice. Given This: Write an algorithm to do this and determine its complexity.A library must build shelving to shelve 200 4-inch high books, 150 8-inch high books, 300 10-inch high books and 180 12-inch high books. Each book is 0.5 inch thick. The library has several ways to store the books. For example, an 8-inch high shelf may be built to store all books of height less than or equal to 8 inches, and a 12-inch high shelf may be built for the 12-inch books. Alternatively, a 12-inch high shelf might be built to store all books. The library believes it costs $2,300 to build a shelf and that a cost of $5 per square inch is incurred for book storage. (Assume that the area required to store a book is given by height of storage area times book’s thickness.) Formulate and solve a shortest-path problem that could be used to help the library determine how to shelve the books at minimum cost. (Hint: Have nodes 0, 4, 8, 10 and 12, with cij being the total cost of shelving all books of height >i and ≤ j on a single shelf.)In practical life, the employees get salaries and pay taxes honestly. Sometimes, the process of drawing salariesand payment of taxes may lead to some interesting situation. Suppose, a person draws salary of Rs. 10,000 permonth. A certain percentage of tax is charged on that amount, which is deducted every month. But if the salaryof the person is more than Rs. 10,000 per month, then the tax rate is different. Similarly if a person is getting Rs.20,000 per month, he/she would be charged more under a different tax rate slab. The interesting situationdevelops if there is an anomaly in the tax rates i.e. a person who is getting higher salary takes home lesser moneyas compared to the other person with less gross salary.To further elaborate it, we suppose that there is company 'C' where 100 or less than 100persons are employed. The salaries of the employees and their tax rates are known to us.We are required to list those unlucky persons, who are getting lesser take-home salary(net salary)…