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
Modify the attached code to generate the display. Your code must use the given variables and use the stream manipulators to format the data.
Compute the average result of the 5 given days.
The result should look identical to the following. Note that the last digit aligns with the last character of the day.
// Student Name Here
// Tarrant County College - COSC 1436
// Professor Keith Smelser
// Week 6 - Average Temps
// Assignment:
// Use the cout Stream Manipulators to produce the expect results for the numeric data
#include
#include
using namespace std;
int main()
{
//Variables
float mondayMaxTemp = 98.1;
float tuesdayMaxTemp = 94.8;
float wednesdayMaxTemp = 90.555;
float thursdayMaxTemp = 86.88;
float fridayMaxTemp = 87.9;
//TODO Compute average temp
float averageTemp;
cout << "********* Max Temperature for this Week *******************" << endl;
cout << " Monday Tuesday Wednesday Thursday Friday Average" << endl;
//TODO add code to create formatted output
return 0;
}
The code is
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
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
- The following code is used to plot a heatmap and the result is shown below. The range of the data that represented using the heatmap is of the range from 0 to 600. It can be seen that the numbers over 400 are all shown in the same color. How would you improve the figure to allow the data with higher values to be stood out? inpert talatlaelat a plt rughts s. leattasetuts', ta ta ruts tiure tt. .heataptaftaghts, in, ptt.shol Ha gers -300 -250 200 -100 O a. Set the parameter vmax to a smaller number. O b. Reverse the color bar. Oc. Set the parameter vmax to a larger number. O d. Show the annotation on the figure.arrow_forwardPlease give correct code. Thanksarrow_forwardthis is my code so far but it its not accurate, not sure if i should def function and then for loop? import csv with open ('TopUni.csv', mode='r') as csv_file: csvReader = csv.reader(csv_file) line = [] for line in csvReader: sum(line) print(line)arrow_forward
- The average amount Sold function is not run as expect. Please fix it. The input file: sales.txt header in picture. It is over 5000 char. I can't copy. 13492785 2017 Jane North; 1000 78534520 2012 Tim South; 95020192756 2017 Linda East; 15000 19273458 2012 Paul West; 500078520192 2017 Mary Jane Doe; 5001 32278520 2012 Victor Smith; 799514278520 2012 Mary Johnson; 12056192785 2017 Tom Baker; 1300 88278529 2012 Diana Newman; 150089278527 2012 William Peterson; 1420098278528 2012 Jim Gaddis; 120099192785 2017 Laura King; 1000 43278524 2012 Ann McDonald; 2000 The output expect: in picture. #include "Sales.h"#include <iostream>#include <sstream>#include <iomanip>#include <fstream>#include <string>using namespace std; const int MAX_SIZE = 30; void readData(string fileName, Sales salesArr[], int n);double calcSalesAvg(Sales salesArr[], int n);void displayOverAvg(Sales salesArr[], int n, double avg);void writeReport(Sales salesArr[], int n, string…arrow_forwardSuppose a csv file contains three comma-separated values (strings) on each line (see the leftcolumn of the example table below). Assume, each line of values are, respectively, thewidth, height, and depth of a box. Write a program called box.py and add thefollowing functions to this program.• read_file() takes a csv filename as a parameter that contains the widths, heights, anddepths of all boxes. This function must read the content of the file, store these values ina 2-D list as shown in the right column of the example table below, and return this list.All strings must be converted to integers before they are stored in the list. Example:csv data 2-D list[[15, 6, 3],[3, 7, 4],[6, 9, 3],[15, 6, 11],[6, 5, 5],[13, 10, 9],[9, 10, 3],[14, 5, 4],[4, 6, 11],[12, 10, 9]]• Add another function called max_volume() to this program that takes this 2-D list as aninput parameter. Each item in that list contains 3 integers representing the dimensions ofa box (i.e., width, height, depth). This…arrow_forwardAdd a prompt to ask the user to input their last name (no spaces ; please use underscores if needed), age and a balance of their choice. Create a new entry in the patient_list array with this information [Important note: you can statically modify the code to have the patient_list array hold an extra entry ; no need to do any dynamic memory allocation to accommodate the new entry]. #include <iostream> #include <cstdlib> #include <cstring> using namespace std; // Declaring a new struct to store patient data struct patient { int age; char name[20]; float balance; }; // TODO: // IMPLEMENT A FUNCTION THAT COMPARES TWO PATIENTS BY AGE // THE FUNCTION RETURNS AN INTEGER AS FOLLOWS: // -1 IF THE AGE OF THE FIRST PATIENT IS LESS // THAN THE SECOND PATIENT'S AGE // 0 IF THE AGES ARE EQUAL // 1 OTHERWISE // TODO: // IMPLEMENT A FUNCTION THAT COMPARES TWO PATIENTS BY BALANCE DUE // THE FUNCTION RETURNS AN INTEGER AS…arrow_forward
- Click cell C9 and insert a VLOOKUP function that looks up the code in cell B9, compares it to the codes and types of art in the range B2:C6, and returns the type of art. Copy the function in cell C9 to the range C9:C54. Hide column B that contains the codes.arrow_forwardWith a single line of code create binned variables with 4 equal width bins for the variables 'UnsecLines', 'Age', and 'MonthlyIncome'Set. Use lambda function within the apply() function. Using a for loop print frequency distribution for each of the binned variables from above. Make sure the bins in the frequency distribution are properly sorted.arrow_forwardEXCEL VBA (a) Write a user-defined function called SumStop which takes an integer n as an input and adds up the values of the cells in row 1 (starting from cell A1) until the value of the sum exceeds n, and then outputs the number of cells used. You may assume that all of the cells in row 1 contain numbers. Use a suitable Do While loop and the cells command. Declare all variable types and include appropriate comments in your code.arrow_forward
arrow_back_ios
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