The output of the following code short int x = 15213; int iy = (int) -x; cout<<"iy=0x"<
Q: B) What is the value of speed when the following code snippet runs successfully? const int…
A: 1) Code snippet in Question B does below activities It defines MIN_SPEED 45 and MAX_SPEED as 65…
Q: Suppose you were given the following code segment: int a[5] = { 1, 2, 4, 8, 16 }; int *p = a; int…
A: Concept of array and pointer is being used here, I have defined everything in comments of code , and…
Q: The Drive-Rite Insurance Company provides automobile insurance policies for drivers. Design a…
A: // Take input from user policy number, customer last name, customer first name, age, premium due…
Q: 2. Electric Bill: Write a program that will calculate and show bills of the Manila Electric Company.…
A: The code is given below.
Q: What is the output of the following code segment? double vall = -7; int val2 = 9;…
A: If we break the calculation into segments. Floor value will return the lower bound of the integer.…
Q: Write code that takes the size of their foot from user and prints out suggested sandal size. Shoe…
A: To give a problem, we have to take value from the user and then checks a condition and show the…
Q: The output of this program when i= 3 and j=4 is ;int i.j ;cin >> i>>j ;cout << (i < 5 || i < j) <<…
A: Find Your Answer Below
Q: void fun (int& x, double y = 2.8, double z=5.4, char c = 'h') if (isupper (c)) cout << x + y-z; else…
A: explanation: when fun call x=3, y=3.6, z=5.4, c=h ( y not equal to 2.8 because we pass y=3.6 if…
Q: lease complete the following function printBox, which accepts three parameters (i.e., char c, int…
A: Since programming language not mentioned using C++ CODE: #include <iostream>using namespace…
Q: Write a program using if-blocks that allows the user to input a taxable income value into a text…
A: According to the Question below the Solution: HTML: <!DOCTYPE html> <html>…
Q: Given the following code and output: int a[] = {10, 20, 30, 40}; cout << a << endl; Example Output…
A: Please find the answer to the above question below:
Q: Question 15 Show the output of the following program: const int SIZE = 5; void incArray(int x[]) {…
A: Answer:
Q: 3. B) What is the value of num when the following code snippet runs successfully? int num = 100;…
A: I give the solution to both with output screenshot I also give the code ,output and code screenshot…
Q: Mortgage bond L, interest rate r =15%. The fixed payments P to pay off the loan over N years is…
A: Given that, For a Mortgage bond L, Interest rate r = 15% Fixed payment…
Q: Print either "Fruit", "Drink", or "Unknown" (followed by a newline) depending on the value of…
A: This is multiple type question, hence only first question has been answered. The question is to…
Q: 4.20 LAB: Warm up: Automobile service cost (1) Prompt the user for an automobile service. Output…
A: In this first of all user get the menu of automobile services then user has to input which service…
Q: 4. The following expression: static_cast(static_cast(7.0/2.0) -2) is evaluated to. . a) 1.0 b) 1.5…
A: According to the information given:- We have to choose the correct option to satisfy the mentioned…
Q: (S), Il ally, I ) #include main() { int x[5], *y,z[5] for(i=0;i void main(){ int x,y; cin>>x; for…
A: Answer is given below. (i) Will encounter a following syntax error(s): The variable ‘i’ is not…
Q: What would be the value of i and j after the ?following code executed ;int i = 5 ;++int j = i ;cout…
A: d) 75 Step by Step Execution : i = 5 j = i++ = 5 ( Value is first used and then incremented , j is…
Q: PRG11: Write a program that will calculate and show bills of the Manila Electric Company. The rates…
A: #include<stdio.h>int main(){ int subId, consumption; float bill; char name[40],type;…
Q: hello, i am having problems with this hw question, Explain the problem with the following code:…
A: I have provided c++ code with comments in step2
Q: analyze the following code .Which of the following is not correct? if (number>0)…
A: In the given code is not correct statement
Q: 2. A) What could go wrong with the following code? double x = 4.12345 double z = 4.12; double y =…
A: Kindly Note: As per our guidelines we are supposed to answer only one question. Kindly repost other…
Q: There are N students in a class. Each student got arr[i] (1 <=i<= N) marks in mathematics exam. Geek…
A: Note: Since no programming language is mentioned. I am attempting this in python. if you need it in…
Q: Assume there is a variable, h that has already been assigned a positive integer value. Write the…
A: In step 2, you will get python code. In step 3, you can see the sample output.
Q: For the following code #include #include int powerof(int base, int pow); int _tmain(int argc,…
A: powerof is a function that takes two parameters base and pow
Q: What will following segment of code output? int x = 5; if (x != 0) cout << "x is a non-zero…
A: The problem is based on conditional statement and output statement.
Q: What is the output of the following code segment?double vall = -9;int val2 = 7;cout<<floor…
A: #include <iostream>#include<math.h>using namespace std; int main(){ double vall =…
Q: The Drive-Rite Insurance Company provides automobile insurance policies for drivers. Design a…
A: According to the information given:- Drive-Rite Insurance Company gives automobile insurance…
Q: What will be the output of code given below: #include using namespace std; int main() { int…
A: Given Code: #include <iostream> using namespace std; int main(){int i=5, j=2;printf("%d…
Q: Write a pseudo code that calculates the total point earned by a football team over a series of games…
A: Pseudocode: Start the program Declare score, i = 0, counter = 0, sum = 0 Get the input scores from…
Q: What is the output of the following code segment? char tl[5] = "good"; char t2[5] = "boys"; char…
A: The above code segment will print the content of t1 and t2 with some random garbage values. In other…
Q: Federal law requires that hourly employees be paid “time-and-a-half” for work in excess of 40 hours…
A: workingHours=float(input("Enter number of working hours: ")); #input working…
Q: Given the code below: type point real a, b end type type (point) v read*, v z=v%a/v%b print*,…
A: Wrong options none of the given code choices ,because option is there type point real a, b end type…
Q: Write a full program that display the area of a rectangle. The program calls the following two…
A:
Q: What is the ouput f the following code #include void fun (int *ptr) { --pt; } int main() {…
A: Given: What is the ouput f the following code #include <stdio.h> void fun (int *ptr) {--pt; }…
Q: 5. Write a program that determines the change to be dispensed from a vending machine. An item in the…
A: The program accepts the input value to a variable. It declared other variables for storing the…
Q: int x = 5, y = 2, z = 3; if ( x z) cout 2 ) { cout << z <<" "<< y-x << endl; cout << z * (x + y)<<…
A: The program is written in C++ Language. Please find the source code and output in the below steps
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: Assume that M is declared as int, and a value is stored in it. How would you check *? whether N is…
A: N is between 3 and 9 So it will be 4,5,6,7,8 Ans is if(M>3 && M<9) This means M is…
Q: Suppose that the input is 0 5 6 4 9 8 –1. What is the output of the following code? (2, 3) Submit…
A: while loop in C++ A while loop statement is used to execute a statement repeatedly as long as the…
Q: Question 6 What are the values of x, y, and z after the following code executes? int x = 0; = 1; int…
A: The answer is given below.
Q: The result of the following program is: #include void Sfintxint &yint &z) [y-y%x-1: z-ax+1) void…
A: let's see the correct answer of the question
Q: int a = 5, b = 12; double x = 3.4, z = 9.1; What are the values of the following expressions? A) b/…
A: Here is the program which execute these statements #include<iostream>using namespace std;int…
Q: fION 15 To assign a double variable d to an int variable x, you writ Ox= d; Ox= (long)d x (int)d3;…
A: This question comes from Programming Language which is a paper of computer science. Let's discuss it…
Q: Given that x = 0, what is the output of this code #include int main (void) { int x; printf…
A: GIVEN: Given that x = 0, what is the output of this code #include <stdio.h> int main (void)…
Q: 3. A fast food restaurant sells the following products: Product Burgersteak Softdrinks Price PhP…
A: I have given C++ code to count the total amount paid by customer to by products.
Q: Examine the following code segment. What will be printed? If there are any errors indicate the…
A: Identify the errors in the program: (i) Syntax error: Variable "i" is not declared. (ii)Syntax…
Q: What is the last value of F after executing the following code? int T=2, F=10; do { while (F =T); O…
A: The "while" loop is a pre-condition check loop that tests the condition of the loop before the…
The output of the following code
short int x = 15213;
int iy = (int) -x;
cout<<"iy=0x"<<hex<<iy<<" == ";
Step by step
Solved in 2 steps
- gien two variables a and b of type int, that have been decalred and gien values, compute their sum then assign it to another int variable,c, that has also already been declared. c++Assume that int a[ 2 ][ 2 ] = { { 1, 2 }, { 3, 4 } }; the value of a[ 1, 1 ] = ______;please code in java.. dont use very advanced coding Integer variables totalFlowers and numFlowers are read from input. A bouquet consists of numFlowers flowers, and the r of flowers is given by totalFlowers. Assign remainingFlowers with the remaining flowers after making as many bouquets possible.Ex: If the input is 13 4, then the output is:Remaining flowers: 1
- Write a code for craps game. Craps is a dice game in which the players make wagerson the outcome of the roll, or a series of rolls, of a pair of dice.The rules of the dice game craps are as follows:You roll two dice. Each die has six faces, which contain one, two, three, four, five and six spots,respectively. After the dice have come to rest, the sum of the spots on the two upward faces iscalculated. If the sum is 7 or 11 on the first throw, you win and play is over. If the sum is 2, 3or 12 on the first throw you lose and play is over. If the sum is 4, 5, 6, 8, 9 or 10 on the firstthrow, that sum becomes your “point.” To win, you must continue rolling the dice until you“make your point” (i.e., roll that same point value). You lose by rolling a 7 before making yourpoint(in python)Write a code for craps game. Craps is a dice game in which the players make wagerson the outcome of the roll, or a series of rolls, of a pair of dice.The rules of the dice game craps are as follows:You roll two dice. Each die has six faces, which contain one, two, three, four, five and six spots,respectively. After the dice have come to rest, the sum of the spots on the two upward faces iscalculated. If the sum is 7 or 11 on the first throw, you win and play is over. If the sum is 2, 3or 12 on the first throw you lose and play is over. If the sum is 4, 5, 6, 8, 9 or 10 on the firstthrow, that sum becomes your “point.” To win, you must continue rolling the dice until you“make your point” (i.e., roll that same point value). You lose by rolling a 7 before making yourpoint.Define an enumeration type triangleType that has the values scalene, isosceles, equilateral, and noTriangle.b. Write a function triangleShape that takes as parameters three numbers, each of which represents the length of a side of the triangle. The function should return the shape of the triangle. (Note: In a triangle, the sum of the lengths of any two sides is greater than the length of the third side.)c. Write a program that prompts the user to input the length of the sides of a triangle and outputs the shape of the triangle.
- The value of x at the end.int x = 1;x = x + 1;x++;What output will be produced by this code segment: for (int i = 5; i > 1; i--) { for (int j = i - 1; j > 1; j--) System.out.print (3 * j - 1); System.out.println(); }Implement the following function which takes the radius of a circle as one of its parameters and stores the circumference and area using the other two parameters.void calcCircleInfo(int radius, int *circumference, int *area)
- Declare an int constant minutesPerHour whose value is 60Define an enumeration type triangleType that has the values scalene, isosceles, equilateral, and noTriangle. Write a function triangleShape that takes as parameters three numbers, each of which represents the length of a side of the triangle. The function should return the shape of the triangle. (Note: In a triangle, the sum of the lengths of any two sides is greater than the length of the third side.) Write a program that prompts the user to input the length of the sides of a triangle and outputs the shape of the triangletrace the following code and give the output. for (int a = 1; a <= 3; a++) for (int b = 1; b <= 3; b++) cout << a+b << endl;