Prelude to Programming
6th Edition
ISBN: 9780133750423
Author: VENIT, Stewart
Publisher: Pearson Education
expand_more
expand_more
format_list_bulleted
Question
Chapter 1, Problem 13RE
Program Plan Intro
To name term used for sequence of characters.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
In CORAL LANGUAGE please and thank you!
Summary: Given integer values for red, green, and blue, subtract the gray from each value.
Computers represent color by combining the sub-colors red, green, and blue (rgb). Each sub-color's value can range from 0 to 255. Thus (255, 0, 0) is bright red, (130, 0, 130) is a medium purple, (0, 0, 0) is black, (255, 255, 255) is white, and (40, 40, 40) is a dark gray. (130, 50, 130) is a faded purple, due to the (50, 50, 50) gray part. (In other words, equal amounts of red, green, blue yield gray).
Given values for red, green, and blue, remove the gray part.
Ex: If the input is:
130 50 130
the output is:
80 0 80
Hint: Find the smallest value, and then subtract it from all three values, thus removing the gray.
1.8.1: Sphere volume. Using C++
Given sphereRadius, compute the volume of a sphere and assign sphereVolume with the result. Use (4.0 / 3.0) to perform floating-point division, instead of (4 / 3) which performs integer division.Volume of sphere = (4.0 / 3.0) π r3 (Hint: r3 can be computed using *)
#include <iostream>#include <iomanip>#include <cmath>
using namespace std;
int main() { double sphereVolume; double sphereRadius;
cin >> sphereRadius;
cout << (4.0 / 3.0) * M_PI * sphereRadius * sphereRadius * sphereRadius;
cout << fixed << setprecision(2) << sphereVolume << endl;
return 0;}
4.
Using Dev C ++, create a program:
Number Conversion:Convert a Binary Number to Decimal, Octal, and Hexadecimal.
The process of how to solve Binary to Octal (ONLY) must be seen at the end of the output or during run time.
Requirements:
The program created should include the following structures:
conditional
looping
programmer-defined functions (no header file creation)
arrays and/or strings
p.s. use beginner code only..
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
Similar questions
- It could perform the four basic arithmetic operations and could locate information stored in tabular form. Choices:arrow_forwardDetermine what will be printed from each output of statement of this code below: #include <iostream> using namespace std; int main() { int apple; int *location; apple = 24; // a is an integer // aPtr is a pointer to an integer location = &apple; // aptr set to address of a cout << "The location of apple is " << &apple << << "\n The value of the location of the apple is location; cout << "\n\nThe value of apple is " << apple << "\nThe value of the location is " << *location; cout << "\n\nOveral inverse operator are as follows" << "\n & (* aPtr) << &*location) << "\n*(&aPtr) '<< *(&location) << endl; return 0; }arrow_forwardUsing Dev C ++, create a program: Number Conversion:Convert a Decimal Number to Binary, Octal, and Hexadecimal. The process of Decimal to Binary(only) must be seen. Decimal to Octal and Hexadecimal only the answer must be seen. Requirements: The program created should include the following structures: conditional looping programmer-defined functions (no header file creation) arrays and/or strings p.s. use cout<< and cin>> onlyarrow_forward
- compute z= y-√2, #include <iostream>#include <cmath>#include <ios>#include <iomanip>using namespace std; int main() {double x;double y;double z; cin >> x;cin >> y; /* Your code goes here */ cout << fixed << setprecision(2); // This will output only 2 decimal places.cout << z << endl; return 0;}arrow_forwardQ.2. [Arithmetic Operators] Write a program to: (C++ Language) Develop a program to convert a number of seconds into hours, minutes, and seconds in a format like HH:MM:SS. Sample Input / Output where the total number of seconds is the only input shown in bold below. ************** Time Converter ************** Enter seconds since day began: 36000 The time is 0:1:40arrow_forwardC language # ASCII Table Project * output all bytes from 0 to 255 * if it represents a printable character, print the actual character * if it is not a printable character, print a dash ("-") instead * print out the hexadecimal value of the byte* format the output into 8 columns (one column per byte) * line up all the columns ## TestsWrite at least one unit test. _This implies that you have at least one function you call._ There are at least two functions you could write (based on the product definition)arrow_forward
- Computer Science Using visual studio 2019 with a C# program create a WCF service to compute the body mass index (BMI) b. Let the user enter his or her weight w, in pounds and height, in inches. Then compute the body mass according to this formula and display the result. Let the user know if they have a healthy BMI or not. b=703w/h^2.arrow_forwardUsing Dev C ++, create a program: Number Conversion:Convert a Decimal Number to Binary, Octal, and Hexadecimal. The process of Decimal to Binary(only) must be seen. Decimal to Octal and Hexadecimal only the answer must be seen. Requirements: The program created should include the following structures: conditional looping programmer-defined functions (no header file creation) arrays and/or stringsarrow_forward.data msg1: .asciiz "\nEnter a lowercase alphabet character: " msg2: .asciiz "\nThe uppercase character is: " .text main: la $a0,msg1 li $v0,4 syscall li $v0,12 syscall move $a0,$v0 jal func1 la $a0,msg2 li $v0,4 syscall move $a0,$v1 li $v0,11 syscall j func2 func1: subi $v1,$a0,0x20 jr $ra func2: li $v0,10 syscall Why do we use subi $v1,$a0,0x20 instruction in func1?arrow_forward
- .data msg1: .asciiz "\nEnter a lowercase alphabet character: " msg2: .asciiz "\nThe uppercase character is: " .text main: la $a0,msg1 li $v0,4 syscall li $v0,12 syscall move $a0,$v0 jal func1 la $a0,msg2 li $v0,4 syscall move $a0,$v1 li $v0,11 syscall j func2 func1: subi $v1,$a0,0x20 jr $ra func2: li $v0,10 syscall Change this program to convert capital letter into small letter. Write down the major changes you make in .text segment only.arrow_forwardQuestion: C++ You require an algorithm that will receive the dimensions of a fish tank from the screen (length, width, height), calculate the volume, and display the volume in gallons to the screen. Second part: Must be able to cin feet and inches and a text file output of the gallon amount and the dimensions. This was the code from the first part of assignment, now I need the Second part #include <iostream> using namespace std; int main ( ) { double l,w,h; cout << “Enter length of fish tank: “; cin >> l; cout << “Enter width of fish tank: “; cin >> w; cout << “Enter height of fish tank: “; cin >> h; cout << “Volume of fish tank is: “; << (l * w * h)/231 << “gallons “ << endl; return 0;arrow_forwardNeed help correcting the 24-hour clock as its showing as regular time! #include <iostream>#include <ctime>#pragma warning(disable : 4996) using namespace std; time_t now = time(0);tm* local = localtime(&now); int hour = local->tm_hour;int minutes = local->tm_min;int sec = local->tm_sec; // Function to display the 12-hour clockvoid Clock12() { // Converts 24-hour clock to 12-hour if (hour > 12) { hour -= 12; } cout << "*****************************" << " " << "*****************************\n"; cout << "* 12-Hour Clock *" << " " << "* 24-Hour Clock *\n"; cout << "* " << (hour < 10 ? "0" : "") << hour << ":" << (minutes < 10 ? "0" : "") << minutes << ":" << (sec < 10 ? "0" : "") << sec << (local->tm_hour < 12 ? " AM" : " PM") << " * ";} // Function to display the 24-hour…arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education