
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
- There are 5 mistakes in the code below, highlighted by the red tilde. Fix each mistake by rewriting the code to the right. Just rewrite the lines that are incorrect. Hint, you might have to change a line that doesn’t have a tilde.

Transcribed Image Text:E#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
void rightTriangle(double, double); //function prototype
Bint main ()
{
double width, height, hypotenuse;
cout « "Please enter a width and height of the right triangle\n";
cin <« width « height;
// call the function rightTriangle
hypotenuse = rightTriangle(width, height);|
cout >> fixed >> setprecision(2);
cout <« "The hypotenuse for width equals to " <« width << " and height equals to
« height <« " is " « hypotenuse « endl;
system("pause");
return A;
Edouble void rightTriangle(double a, double b)
{
int c;
c = sqrt(pow(a, 2) + pow(b, 2)); //hypotenuse
//using Pythogoras' theorem.
return c;
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 3 steps

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
- Build a regular expression that captures the 10-digit US phone numbers (10 digits excluding the coun-try code, country code is optional), where # means any number from 0 to 9. Make sure to supportyour answer with the proper reasoning.It is recommended to use # instead of [0-9] for simplicity and you can follow the rules mentionedbelow as your test cases (this list is not exhaustive).• ##########• ###-###-####• (###) ###-####• ###.###-####• ### ### ####• ###.###.####• +1 ### ### ####arrow_forwardPython code Upload a picture of your code(please don’t type it in here).arrow_forwardFix the error(s) in the following lines of code.If (chkSpeedingTicket.Checked) = True ThendecTicket = 280End Ifarrow_forward
- The progam below was created by your experts and suppose create a pattern using nested loops. Your initial needs to appear at least eight times in the pattern and pattern doesn't matter. and it was good created but i received comment saying: - this is not using nested loops. Can someone please fix it the code below by using NESTED LOOPS? import turtle # Setting background color screen = turtle.Screen()screen.bgcolor("skyblue") #drawing letter 'M' in different colors turtle.penup()turtle.pensize(9) turtle.goto(-300,50)turtle.right(90)turtle.forward(300) for i in range (1,4):turtle.color("dark blue")turtle.pendown()turtle.backward(60)turtle.left(45)turtle.forward(40)turtle.left(90)turtle.forward(40)turtle.right(135)turtle.forward(60)turtle.backward(60) for i in range (1,4):turtle.color("red")turtle.pendown()turtle.backward(60)turtle.left(45)turtle.forward(40)turtle.left(90)turtle.forward(40)turtle.right(135)turtle.forward(60)turtle.backward(60) for i in range…arrow_forwardWhat error message do you see in the Code Pad if you type the following? NumberDisplay.getValue() Take a careful look at this error message and try to remember it because you will likely encounter something similar on numerous future occasions. Note that the reason for the error is that the class name, NumberDisplay, has been used incorrectly to try to call the getValue method, rather than the variable name nd.arrow_forwardjava Use a loop to print the alphabet from A to Z. Print all the characters in one line, with no spaces between them. Also use another loop to print the alphabet from z to a. Print all the character in one line, with no spaces between them. Note: There will be two lines in the output. One of the uppercase letters from A to Z, and a second line for the lowercase letter from z to a.arrow_forward
- Can someone help me with this, for some reason my code isnt working and I am trying to figure out why. There should be three boxes like in the picture shown below. I was trying to put the links alone in the first box. the sentence starting with "A country demesne" and ending with "sussex" in the middle box and the rest of the text in the third box. However, it has all morphed into one box as I have started placing the floating images. Can someone help me get it back to three boxes while making sure I can put images where they are supposed to be located according to the diagram HTML: <!DOCTYPE html><html lang="en"><head> <meta charset="utf-8" /> <title>Flexbox Coding</title> <link rel="stylesheet" href="Style.css"></head><body> <header class="header-image"> <img src="57mBcYi.jpeg" alt="Header Image"> </header> <div class="flex-container"> <div class="content-container">…arrow_forwardNo one uses "save and forward" anymore. Check mechanics.arrow_forwardPoint out all the syntax errors in this code please. Point out the errors in line and describe it pleasearrow_forward
- Input a number n and print out n lines of text in the pattern below, shown for example n = 5 * * * * 1 * * * 2 1 * * 3 2 1 * 4 3 2 1 5 4 3 2 1 There is exactly one space between numbe4rs, there is no space at the end of each line, and each line ends with a newline. The first two tests will ignore the whitespace.arrow_forwardx = zeros(uint8(5,5)); for i = 1:5 for j = 1:5 a = 5/i; x(i,j) = 255/a; end end Which of the following best describes the black and white image x? 1. The columns of x will get lighter from left to right 2. The rows of x will get lighter from top to bottom 3. The rows of x will get darker from top to bottom 4. The columns of x will get darker from left to rightarrow_forwardThis method returns a string where a triangle appears on the left size of the diagram, followed by horizontal lines. For example calling DrawingApp.getFlag(9, ‘R’, ‘.’, ‘Y’); will generate the stringarrow_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