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
Question
Given a certain temperature in Fahrenheit and a maximum wind velocity (speed) in Miles Per Hour, calculate and display a series of wind chill factors from a wind velocity of 1 MPH to the maximum wind velocity in a table. The user is allowed to specify a maximum wind velocity of up to 50 MPH.Here are the programming instructions for this project:
•You must use coding techniques from only Chapter 1 through Section 5.1 in our textbook. You may not use any other coding techniques from any other sources.
• Create a project and class in BlueJ named Project2
• In main(), do the following:
-Prompt the user to enter the current temperature and use a Scanner object to store it in a double variable.oCall a method named getVelocity that returns an integer and has a Scanner parameter. This method must use a either a while loop or a do-while loop to prompt the user to enter the maximum wind velocity (speed) and return it. A valid value for the maximum wind velocity is between 2 and 50 (inclusive). As long as the value is not valid, display a message saying the value is invalid and prompt the user to enter the value again.The condition for this loop must contain a Boolean expression with relational operators (one or more of these: <, >, <=, >=, ==, !=, &&, !!).
-Display the first line of the table with column headers for the current temperature, the wind velocity (speed), the calculated wind chill factor, and what the temperature actually feels like. You will need to use the \t escape sequence to put spacing between the columns.
-Within a for loop, call a method named wcfactor that returns a double and has a double parameter and an integer parameter. The method will return a value for the wind chill factor, based on the following formula (T is the temperature, V is the wind velocity):
W= 35. 74 + 0.6215∗??−35. 75∗??0.16+ 0.4275∗??∗??0.16
-Display each line of the table using a System.out.printfstatement. The data should be in this order: current temp, wind speed, calculated wind chill factor, and what the temperature actually feels like. Each line of data must do the following:
The current temp must be converted to an integer using casting so that no decimal places are displayed.
The calculated wind chill factor must be rounded to 2 decimal places.
The Math.round() method must be used to display what the temperature actually feels like with no decimal places.
You must use field widths for each of the four data items to make each data item appear near the middle of each column. You are not allowed to use any escape characters for any of the four data items. Refer to the sample output document in the Files area of Canvas for an example
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 2 steps with 3 images
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
- provide c++ coding using data structure and algorithm of this cinema ticket booking system i need class file and main file separatelyarrow_forwardUse C++ code and draw a flow chart Write a program that simulates a magic square using 3 one dimensional parallel arrays of integer type. Each one of the arrays corresponds to a row of the magic square. The program asks the user to enter the values of the magic square row by row and informs the user if the grid is a magic square or not. Project Specifications Input for this project: Values of the grid (row by row) Output for this project: Whether or not the grid is a magic square Programmer’s full name Project number Project due date Processing Requirements Use the following template to start your project: #include<iostream> using namespace std; // Global constants const int ROWS = 3; // The number of rows in the array const int COLS = 3; // The number of columns in the array const int MIN = 1; // The value of the smallest number const int MAX = 9; // The value of the largest number // Function prototypes bool isMagicSquare(int arrayRow1[], int…arrow_forwardA program is needed to monitor the user’s input and make sure that the text that was entered has balanced paranthesis. There are two types of paranthesis possible in the text: (a) The usual type which uses the symbols ( and ) (b) The square type which uses the symbols [ and ] Note that the text can also have spaces and the alpabet letters from a to z. Apply what you learned in this course (and especially in Chapters 5 and 7) to design a Nondeterministic Push-Down Automaton (NPDA) that can be used to parse the text and make sure that the paranthesis included in it are balanced and that every open paranthesis must be closed with the close paranthesis symbol. For example, the following text does not contain syntax errors and the NPDA should accept it and stop in a final state: The cat (which was running) jumped in to the (normal (although large)) hat. We should buy (in the case that [all are here] two large (bottles) of Coke). However the following text has a syntax error because the…arrow_forward
- Use C++ code and draw a flow chart. I only want the FLOWCHART, not the code. Write a program that simulates a magic square using 3 one dimensional parallel arrays of integer type. Each one of the arrays corresponds to a row of the magic square. The program asks the user to enter the values of the magic square row by row and informs the user if the grid is a magic square or not. Project Specifications Input for this project: Values of the grid (row by row) Output for this project: Whether or not the grid is a magic square Programmer’s full name Project number Project due date Processing Requirements Use the following template to start your project: #include<iostream> using namespace std; // Global constants const int ROWS = 3; // The number of rows in the array const int COLS = 3; // The number of columns in the array const int MIN = 1; // The value of the smallest number const int MAX = 9; // The value of the largest number // Function prototypes bool…arrow_forward4arrow_forwardPython help... Suppose variable s has been assigned in this way: s = '''It was the best of times, it was the worst of times; it was the age of wisdom, it was the age of foolishness; it was the epoch of belief, it was the epoch of incredulity; it was ... ''' (The beginning of A Tale of Two Cities by Charles Dickens.) Then do the following, in order, each time and show the result (e.g., show assignment statement and result after each): (a) Write a sequence of statements that produce a copy of s, named newS, in which charactersperiod (.), comma (,), semicolon (;), andend of line (\n) have been replaced by blank spaces. (b) Remove leading and trailing blank spaces in newS (and name the new string newS). (c) Make all characters in newS lowercase (and name the new string newS). (d) Compute the number of occurrences in newS of string 'it was'. (e) Change every occurrence of was to is (and name the new string newS). (f) Split newS into a list of words and name the list listSarrow_forward
- Solve In Python Provide Screenshots of input and output You have been asked by the Olympic committee to write a program for scoring the Olympic diving events. In an Olympic diving event, each dive has a degree of difficulty (DD). The dives are evaluated by a panel of 7 judges who can award 0 to 10 points. To determine an athlete's final score for a dive, the highest and lowest judges scores are discarded and then the average of the rest of the scores are calculated. The average is then multiplied by the DD, resulting in the final score for the dive. Write a program that will read in the attached data file that contains the event information. Each tab separated line will contain in order: -A diver name -The DD -7 scores for the dive Your program should parse this file and output the divers name, the dive DD, and the score for that dive. REMEMBER to submit your source code, and a screenshot of your output. The input file should be attached to this dropboxarrow_forwardThe (x, y) coordinates of the hand at the top of a robot arm are given by: x = L, cos(8,) + L, cos(8, + 0,) y = L, sin(0,) + L,sin(8, + 02) Where Li and L2 are the distances of the parts of the arm from the shoulder to the elbow and from the elbow to the hand, 01 and 02 are the angles that these parts make with the x-axis. These angles can be expressed as: 0,(t) = a,t5 + a,t“ + azt³ 02(t) = bịt5 + b;t + b3t³ where t is the time. We assume that the arm starts to move at t= 0s and stops at tf=2s. The conditions that the angular position G1(t), angular velocity and angular acceleration should meet at the final time tf = 2 (in sec) are expressed in the following matrix form and allow us to obtain the coefficients a1, az and a3: 25 24 23 3x22||a2 = [az. [01f – 010] 5x24 4x23 | 20x23 12x22 6x2 with 0lf=43x/180, 610 = -197/180. a) Use MATLAB left division to solve the above system and get the coefficients a1, az and as b) Similarly the coefficients b1, bɔ and b3 can be obtained by solving a…arrow_forwardCreate a technique for reducing two counts from 10,000 to 1 and then displaying their values on the computer screen. To minimize the number of counters, your program will employ a function.arrow_forward
- Modify question 2 from Lab 2 such that if the value for Celsius is 100 or more, also display “Above or equalBoiling point of Water”Otherwise, display “BelowBoiling point of Water” python codingarrow_forwardI don't want the code, I only want the flow chart Write a program that simulates a magic square using 3 one dimensional parallel arrays of integer type. Each one of the arrays corresponds to a row of the magic square. The program asks the user to enter the values of the magic square row by row and informs the user if the grid is a magic square or not. Project Specifications Input for this project: Values of the grid (row by row) Output for this project: Whether or not the grid is a magic square Programmer’s full name Project number Project due date Processing Requirements Use the following template to start your project: #include<iostream> using namespace std; // Global constants const int ROWS = 3; // The number of rows in the array const int COLS = 3; // The number of columns in the array const int MIN = 1; // The value of the smallest number const int MAX = 9; // The value of the largest number // Function prototypes bool isMagicSquare(int…arrow_forwardDraw flow chart for this #include int main de int n; } printf("Enter the height "); scanf("%d", &n); // Loop over the rows of the triangle for (int i = 0; i = n-1-i && j <= n-1+i) { printf("*"); = } // Otherwise, print a space else { } return 0; printf(" "); } } // Move to the next line of output printf("\n"); Write a program that outputs a right-side- up triangle of height n and width 2n-1;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