Q1. Write a program in C++ language to evaluate this equation: x3 + sin x- y ÷ 2 if x < 20 | 1 y2 --+x mod 3 if x > 20 y = 4 cos y +– x x y if x = 20
Q: Q1. Write a program in C++ language to evaluate this equation: х3 + sin x - у 3D2 if x 20 --+x mod…
A: We need to write a program in the C++ language to evaluate the given expressions of y for 3 given…
Q: Consider the following C program segment. Rewrite it using no gotos or breaks. j = -3; for(i=0;i0)…
A: The problem is based on rewriting the given code snippet in C programming language.
Q: S(x, n)= X/2! -(X')/4! + (XV6!-(X'V8! + (X2n-1)/2n!. Define the functio pwr(x.y) to compute x terms…
A: For the given problem, we need to compute : S(x,n) = (X/2!) - (X3/4!) + (X5/6!) - ............. +…
Q: Write a C program to print all Strong numbers between 1 to n. (Strong numbers are the numbers whose…
A: PROGRAM STRUCTURE: Include the required header files. Start the definition of the main function.…
Q: Write a C++ program that increase & decrease the value of the variable x by 1 if x is an odd *…
A: #include <iostream> using namespace std; int main(){ //declaring variable int x;…
Q: Q1. Write a program in C++ language to evaluate this equation: x3 + sin x-y 2 if x 20 y = 4 cos y +…
A: #include <iostream>#include <cmath> using namespace std; int main(){ float x,y;…
Q: * write a C program that inputs the old salary (os) and the new salary (ns) of an employee. Then it…
A: The flowchart is a diagram in which we represent the problem solution in a pictorial way by using…
Q: Q1. Write a program in C++ language to evaluate this equation: x3 + sin x - y ÷ 2 if x 20 - -- y =…
A: #include <iostream>#include <cmath>using namespace std;int main(){ float x,y;//to…
Q: Q1. Write a program in C++ language to evaluate this equation: i? + cos j-j mod 3, if i5 y = (sini+;…
A: Program: #include <iostream> #include <cmath> #include <bits/stdc++.h> using…
Q: Write a C++ program with the following specifications: a. Define a C++ function (name it function…
A: Below I have provided a solution in C++ programming
Q: (a) Write a program in C Langunge to read an integer number (X) to calculate and print Y values,…
A: Note: we are only allowed to solve one question in one post. I am solving the first on here. To get…
Q: Question 3: Write a C++ program to compute the following: N = n * (n-10) * (n-20) * (n-30)... * 1/M,…
A: Need to write program in C++ to calculate : N = n*(n-10)*(n-20)*(n-30) ... * 1 / M, where n and M…
Q: Write a program in c++ to determine the sum of digits of number. If the sum is divisible by…
A: Program Approach - Use the necessary header files needed for the program. Define the function named…
Q: Write a C++ program to calculate the following, using If-Else statement. Z2 +3 x=-1 Y= Z3 + 2 x=0 2Z…
A: The inputs will be x and Z whereas the output will be the value of Y
Q: Please write a C++ program that will accept 3 integer numbers from the user, and then output these 3…
A:
Q: Write a program in C language using switch case statement to evaluate the following formulae and…
A: #include<stdio.h> #include<math.h> int main()…
Q: Write a C++ program with the following specifications: a. Define a C++ function (name it function…
A: Below I have provided C++ Programming. Also, I have attached the screenshot of the code and output…
Q: 4. Consider the following C program segment. Rewrite it using no gotos or breaks. = -3; j for (i =…
A: Here in this question, we are given a code snippet and we have to remove goto and break statements.…
Q: Q1. Write a program in C++ language to evaluate this equation: x + sin x-y +2 if x 20 4 cos y +- XX…
A: “Since you have asked multiple question, we will solve the first question for you. If you want any…
Q: Q1. Write a program in C++ language to evaluate this equation: х3 + sin x — у %3D 2 if x 20 y = 4…
A: Note: As per policy we have to answer only first question and also second question is incomplete.…
Q: Write C program that can solve the following equation: 2= (x-y*wtx)/x 2= (x-y*w+y)/y otherwise z=…
A: Write a C program to calculate the value of z according to the constraints.
Q: rite a C program that shows the function of an atm machine. First ask user to select language, enter…
A: the code is given below : //header file #include <stdio.h> #include <conio.h> #include…
Q: XYZ Telegram Company charges P18.50 for a telegram that do not exceed 12 words and P1.50 for every…
A: C program: #include <stdio.h> int main() { char c; int words; scanf("%c",&c);…
Q: Write a C program that asks the user to choose 1 for squared value and 2 for cubed value then ask…
A: #include <stdio.h>int main(){ //prompting input printf("Enter 1) for squared value and…
Q: Homework 1. what is the output of the following piece of code in C++, assume: x=4, y=6: if ( x 5 )…
A: Step 1:- Explanation:- 1.int x=4;Declare and initialized the variable 2.int y=6Declare and…
Q: Write a C program to compute the telephone bill of a customer. Monthly rental is Php 100. Rates are…
A: The program is written in C. Find the program and output in below steps.
Q: Write a c++ program to display a calendar for a given year. Type of Branches such as switch…
A: A required C++ program is as follows, #include<iostream> #include<iomanip> using…
Q: Question 1/ Write a C++ program to calculate Fubanaci numbers Xn, n=1,2, ...,1000 Xn+1= Xn+ Xn-1,…
A: below is the program to find fibonnaci number with output
Q: Write a C++ program that reads a five-digit integer value representing MINUTES. The program should…
A: Note : Since there are multiple questions, according to the guidelines I have done the first…
Q: Write a complete C program for the following question * Write C program to find the result of X in…
A: code:-- // for get power of the any function#include <math.h>#include <stdio.h> int…
Q: Q # 4. Illustrate your knowledge of C-Programming by implementing a 'Game of Dice'. User will start…
A: PROGRAM CODE: #include <stdio.h>#include <stdlib.h>int menu();int roll_a_dice(); int…
Q: Write a C# program that converts feet to meters. The program sh in three-foot increments and the…
A: Note: The program print the equivalent meters of the inputted value along with three increments in…
Q: Write a program in C to compute the roots of a quadratic equation (ax² + bx + c = 0). The roots of…
A: We have to write a c program to compute the roots of the quadratic equations.
Q: Write a program in C++ language to evaluate the equation below: 1 + sin x - 3x if x 20
A: Given Function: y = 1/x2 + Sin(x) - 3x if x <=20 y = Cos(x) - x % 2 + x3 if x > 20 y is…
Q: Write a C++ program that allows the integers 1, 2, 3.. to be added until the sum exceeds 20 million.…
A: The c++ program is given below:
Q: Q1. Write a program in C++ language to evaluate this equation: + sin x – y + 2 1 --+x mod 3 if x 20…
A: #include <iostream>#include <cmath>using namespace std;int main(){ float x,y;//to…
Q: Write a c program that display the water invoice price on the screen as follows, according to the…
A: Below is the required code in C language. Program Approach: Include necessary header files to get a…
Q: Write a C++ program to compute the volume of a cone using dynamic initialization feature. The volume…
A: program to compute the volume of a cone using dynamic initialization feature. The volume of a cone…
Q: Write a C++ program to find GCD of two numbers. Conditions- 1.Write function GCD(int a,int b) 2.…
A: - The question is to find the GCD of two numbers using a function with one line of code. - We can…
Q: Write a C++ program with the following specifications: a. Define a C++ function (name it function…
A: #include <iostream> using namespace std; // the required functiondouble function_StudentID(int…
Q: Write a FORTRAN 90 program that calculates the real roots of any quadratic equation ax? + bx + c = 0…
A: Given below is FORTAN program to find roots of quadratic equation (Well explained using comment)…
Q: Write a program in C++ language to evaluate the equation below: + sin x - Зx if x 20
A: Use an if condition to check value of x In built trigonometric functions accept angle in radians
Q: Q1. Write a program in C++ language to evaluate this equation: i? + cos j - j mod 3, if i 5 y = sin…
A: #include <iostream>#include<cmath>using namespace std; int main(){ //declaring…
Q: Write a C++ program that assign a value to double variable cost depending on the value of integer…
A: Code #include<iostream>#include <stdio.h>using namespace std; int main(){ double…
Q: 1. Write a C++ program which take number of consumed units as input and calculate the electricity…
A: THIS IS A MULTIPLE QUESTION BASED PROBLEM. ONLY FIRST QUESTION IS SOLVED. KINDLY SEND THE REMAINING…
Q: Write a C program to calculate the value of y as following: (n is a real number given by user) 5 2i…
A: Program Description: To write a C program to calculate the value of y as follows: (n is a real…
Q: 4. Consider the following C program segment. Rewrite it using no gotos or breaks. j - -3; for (i =…
A: Given code:- j = -3; for (i = 0; i < 3; i++) { switch (j + 2) { case 3: case 2: j--; break; case…
Q: Write program in C++ that 10 computes the following: y=1+1/x + 2/x^2 + 3/x^3 +...........+ n/x^n
A: Here I have taken input from the user for the value of x and n. Then I have used for loop to…
Q: I would like to ask how I can answer a C language problem domain where I should create a C program…
A: Below i have specified:
Q: Write a C++ program that assign a value to double variable cost depending on the value of integer…
A: #include <iostream>using namespace std;int main(){ //For user input integer distance int…
Step by step
Solved in 3 steps with 4 images
- Illustrate your knowledge of C-Programming by implementing a ‘Game of Dice’.User will start with 3 lives and 100 initial points. Program will ask the user to rollthree dices. If sum of three dices is more than or equal to 15, user will get 10 points. If sum is in the range 10 to 14, user will get 5 points. If sum is less than 10, user willget -10 points. If sum is 3, user will lose one life.For every increase of 50 points, user will get one new life and for every decrease of50 points, user will lose one life. If at any point, user has 200 or more points,program will display message, ‘Congratulations, You Win!!!’ and end. If user haszero lives or zero points, program will display the message ‘Game Over. Sorry, YouLose.’ and end.Program will use the following user defined functions to implement the gameFunction ‘DisplayGameRules()’ will display the following message on screen.############################################## ROLL the DICE GAME…Illustrate your knowledge of C-Programming by implementing a ‘Game of Dice’.User will start with 3 lives and 100 initial points. Program will ask the user to roll three dices. If sum of three dices is more than or equal to 15, user will get 10 points. If sum is in the range 10 to 14, user will get 5 points. If sum is less than 10, user will get -10 points. If sum is 3, user will lose one life. For every increase of 50 points, user will get one new life and for every decrease of 50 points, user will lose one life. If at any point, user has 200 or more points, program will display message, ‘Congratulations, You Win!!!’ and end. If user has zero lives or zero points, program will display the message ‘Game Over. Sorry, You Lose.’ and end.Program will use the following user defined functions to implement the game Function ‘DisplayGameRules()’ will display the following message on screen.############################################## ROLL the DICE GAME…Write a C++ program that accepts the rectangular coordinates of two points (x1,y1) and (x2,y2), calculates the distance of each point from the origin, and calculates the distance between two points.
- write a C program XYZ Telegram Company charges P18.50 for a telegram that do not exceed 12 words and P1.50 for every succeeding word, plus P5.00 service charge if type of delivery is special. Create a program that accepts the number of words in a telegram and the type of delivery ‘S’ for special if the customer desires for a special delivery. Compute and display the customer’s charge.Create a program in the C++ programming language To calculate the value of the following equation: X = a3 + b2 + c calculate the value of x with a, b, c, as input valuesWrite a C program that prompts the user to enter a number that represents his/her type as follows: 1 for student 2 for lecturer 3 for the administrative employee If the user is a student, then prompt the user to enter another number to determine his/her level as follow: 1 for Bachelor student 2 for Graduate student
- Write a c program that calculates the potential energy of 3 charges q1=1, q2=2, q3=3 located at points (1,2,3), (3,−4,−5), and (−4,2,−6) respectively. The units are coulombs forcharge and meters for coordinates. The energy is given by the expression; U=k(q1q2/r12+q2q3/r23+q1q3/r13) where rij is the distance between the charges qi and qj, and k= 9×109in SI units.Your program should print the result on the screen.I would like to ask how I can answer a C language problem domain where I should create a C program that gets the three largest prime number from x to y, where x and y are given by the user. Other conditions involve that if there are no prime numbers in the user-specified range, the program must print zero. Also, if there are is only one prime number, the program must print that particular number. If in case there are two prime numbers in the given range, then both those prime numbers should be printed. This problem domain should be answered without the use of arrays and string operators, and should highlight pointers and parameter passing.Q1. Write a program in G+ language to obtain the equation below, for values of x from (1~ 20), by using for statement: 2 X o Y=—+cosix— vX+ — 4 Ix|
- num 3 pls in c ++ answer it as simple as possibleWrite a C program using if-else. The program reads one integer number k. Then it reads one real number f. According to k, the program will calculate the value of n and prints the result according to the following table:kRequired Calculation4 or 5n= fraction numerator 3 f minus 6 over denominator 7 end fraction space. straight piAny other valueWrong entered numberWrite 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.