Prelude to Programming
6th Edition
ISBN: 9780133750423
Author: VENIT, Stewart
Publisher: Pearson Education
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
Chapter 1, Problem 28RE
Program Plan Intro
a. To evaluate the value of expression X * Y ^ 2 / 12.
Program Plan Intro
b. To evaluate the value of expression ((X + Y) * 2 − (Y − X) * 4) ˆ 2.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
If x = 2222 , what is the value of each of the following expressions ?
x % 10
x / 10
(x / 10) % 10
x / 100
(x / 100) % 10
in the United States, telephone numbers consist of a three digit area code followed by a seven digit local number. Suppose neither the first digit of an area code nor the first digit of a local number can be a zero but that all other choices are acceptable.
do not use commas when you write your number. For example enter 3356789 NOT 3,456,789
Evaluate the following expressions if x is 10.5, y is 7.2, m is 5, and n is 2.
x / (double)m =
x / m =
(double)(n * m) =
(double)(n / m) + y =
(double)(n / m) =
Chapter 1 Solutions
Prelude to Programming
Ch. 1 - A computer _________________ is a list of...Ch. 1 - Prob. 2RECh. 1 - Prob. 3RECh. 1 - The term _______________ refers to the numbers,...Ch. 1 - The first of the following statements WriteEnter...Ch. 1 - Prob. 6RECh. 1 - Prob. 7RECh. 1 - In most programming languages, variables that...Ch. 1 - Prob. 9RECh. 1 - A(n) __________ statement is displayed on the...
Ch. 1 - A floating point variable requires __________...Ch. 1 - Roughly speaking, a(n) _____ is any symbol that...Ch. 1 - Prob. 13RECh. 1 - Prob. 14RECh. 1 - Prob. 15RECh. 1 - Prob. 16RECh. 1 - Prob. 17RECh. 1 - Prob. 18RECh. 1 - Prob. 19RECh. 1 - Prob. 20RECh. 1 - Prob. 21RECh. 1 - Prob. 22RECh. 1 - Prob. 23RECh. 1 - Prob. 24RECh. 1 - A rational number is any number that can be...Ch. 1 - T A number stored as an integer takes up less...Ch. 1 - If the value of the variable MyAge is 3, then the...Ch. 1 - Prob. 28RECh. 1 - Prob. 29RECh. 1 - Suppose X=3 and Y=4. If all parentheses were...Ch. 1 - Suppose X=14. Give the value of each of the...Ch. 1 - Suppose X=12,Y=6, and Z=5. Give the value of each...Ch. 1 - What is the difference between the following two...Ch. 1 - Given that the variable named Boy =Joey� and the...Ch. 1 - Prob. 35RECh. 1 - Write a pair of statements that prompts for and...Ch. 1 - Write a pair of statements that prompts for and...Ch. 1 - Write a series of statements that does the...Ch. 1 - Write a series of statements that does the...Ch. 1 - Suppose that Number1=15 and Number2=12 are both of...Ch. 1 - If Name1=Marcy,Text1=isnow,Text2=yearsold., and...Ch. 1 - It Character1 and Character2 are single...Ch. 1 - Exercises 43-50 refer to the following program:...Ch. 1 - Exercises 43-50 refer to the following program:...Ch. 1 - Exercises 43-50 refer to the following program:...Ch. 1 - Exercises 43-50 refer to the following program:...Ch. 1 - Exercises 43-50 refer to the following program:...Ch. 1 - Exercises 43-50 refer to the following program:...Ch. 1 - Prob. 49RECh. 1 - Exercises 43-50 refer to the following program:...Ch. 1 - Write a list of instructions (like those that...Ch. 1 - In Programming Challenges 2-6, write a program...Ch. 1 - In Programming Challenges 2-6, write a program...Ch. 1 - In Programming Challenges 2-6, write a program...Ch. 1 - In Programming Challenges 2-6, write a program...Ch. 1 - In Programming Challenges 2-6, write a program...
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Find out the final values of a,b and c where following expressions are executed sequentially:[4]int a = 2, b =3, c;a = (b++) + (++b) + a;c = a>b ? a:b;b = (a++) + (b--) + a;c = c++*b--;arrow_forwardSuppose you have a certain amount of money in a savings account that earns compound monthly interest, and you want to calculate the amount that you will have after a specific number of months. The formula, which is known as the future value formula, is:F=P×(1+i)tThe terms in the formula are as follows:o F is the future value of the account after the specified time period.o P is the present value of the account.o i is the monthly interest rate.o t is the number of months.Write a program that prompts the user to enter the account’s present value, monthly interest rate, and the number of months that the money will be left in the account. The program should pass these values to a function named futureValue that returns the future value of the account, after the specified number of months. The program should display the account’s future value. i attached the screenshot of the output so the output should look like that.arrow_forwardLet p = "Paris is called the City of Lights" and let q = "The Eiffel Tower is locatedin Paris". Write the English statements corresponding to each of the following:(i) ∼p V q(ii) p → q(iii) p V q(iv) ∼p ʌ∼q(v) ∼(p V q).arrow_forward
- Give all possible final values of variable × in the following program. Explain.int x = 0; sem s1 = 1, s2 = 0; co P(s2); P(s1); x = x*2; V(s1); || P(s1): x = x*x; V(s1);|| P(s1); x= x+3; V(s2); V(s1); ocarrow_forwardIf L1={w∈{a,b}* | w starts with a} and L2={w∈{a,b}* | |w|≤ 3} then | L1 ∩ L2 | = a) 15 b) infinity c) 7 d) 12 e) 8 f) 4arrow_forwardFor each expression in the left-hand column, indicate its value in the right-hand column. Be sure to list a constant of appropriate type (e.g., 7.0 rather than 7 for a double, Strings in "quotes"). Expression Value (int) 9.0/2 23 % 5 - (16 % 10) 1.5 * 2 - 6 / 4 “1”+1 (2+3)+”Hello”+4+2*3 23456/100%10 “a”+4-2arrow_forward
- Evaluate the following expressions if x = 10.5 y = 7.2 m = 5 n = 2arrow_forwardImage shows the question, below is an example output: Latitude: 23 [FAILED] Calculated CRC: 3 Expected CRC: 6 1011100010110000--------00001000 0000100000001011--------00000011 Longitude: 80 [FAILED] Calculated CRC: 5 Expected CRC: 4 10100000001011000000----------0001000000 00010000000001011000----------0000011000 00000110000000010110----------0000001110 00000011100000001011----------0000000101 Elevation: 13548 [OK] 1101001110110000010110000000000000-----------------01100011101100000 0110001110110000001011000000000000-----------------00111011101100000 0011101110110000000101100000000000-----------------00010111101100000 0001011110110000000010110000000000-----------------00000001101100000 0000000110110000000000001011000000-----------------00000000110100000 0000000011010000000000000101100000-----------------00000000011000000 0000000001100000000000000010110000-----------------00000000001110000 0000000000111000000000000001011000-----------------00000000000101000…arrow_forwardR.4.8 What are the values of the following expressions? In each line, assume that double x = 2.5; double y = -1.5; int m = 18;int n = 4; a. x + n * y - (x + n) * yb. m / n + m % nc. 5 * x - n / 5d. 1 - (1 - (1 - (1 - (1 - n)))) e. Math.sqrt(Math.sqrt(n)) a.) 2.5+4*-1.5-(2.5+4)*-1.5=2.5-6-(6.5)*-1.5=2.5-6+9.75=2.5+3.75=6.25 b.) 18/4 + 18%4= 4 + 2=6 (In programming language “/“ symbol will produce the closest number to the answer and round down in this case 4*5 = 20, take the 5 and round down to 4 which is closest to 18/4. Furthermore in programing language the “%” symbol will only get the remainder of 18/4=2.) c.) 5*2.5-4/5=12.5-0=12.5 d.) 1-(1-(1-(1-(1-4))))= 1-(1-(1-(1-(-3))))= 1-(1-(1-(4)))= 1-(1-(-3))= 1-(4)=-3 e.) Math.sqrt(Math.sqrt(4))=arrow_forward
- The singaporean bus has 7 rows (lettered from A to G) with 8 seats each row(numbered 1 through 8) Write a C++ program that allows users to enter a row and seat request until a sentinel value (both 0 values) is entered. If the row or seat number is invalid, issue an error message. Otherwise, determine whether the seat has already been reserved. If so, display an error message; if not, charge the user Php450.00 for a ticket and display a total of the user’s purchase. Accept continuous seat numbers until the user enters the sentinel value. When the user enters a sentinel, display the number of seats taken and the number of available seats in the bus. Use file streaming so that when the program terminates, the information is saved.arrow_forwardUse C# (:Write an app that reads in a 5 digit number and determines if it is a palindrome. A palindrome is a number that reads the same backward as it does forward, for instance: 12321, 44444 or 22722. If the number inputted is not 5 digits long, display an error message and allow the user to input another number.arrow_forwardIf f(n) is the number of times that y=y+A[i]; is executed in the code segment below, which of the following is the correct big-Oh notation for f? y=0;for(j=0;j<n;j++) { i=n; while(i>0) { y=y+A[i]; i=floor(i/2); }} Group of answer choices O(n2‘) O(n) O(2n) O(nlog2n)arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Programming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:CengageProgramming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage LearningEBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT