Database System Concepts
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
Bartleby Related Questions Icon
Related questions
Question
Need help writing
this code please I am not sure what variables to use
Transcribed Image Text:Write a MIPS assembly program that asks a user to input a list of real numbers
(represented as single precision floating point numbers) and then prints out the average and
variance of those numbers. The program should first ask the user how many numbers they wish
to enter and validate that this number is greater than 1. Assuming the user inputs n, then the
program should perform n system calls to collect these numbers.
Assuming the numbers are given by x1, x2,
by:
18
=
1
n
n, then the average and variance are given
IM3
æk
and
1
n
var(x)
=
n
- 1
(2kg)
k=1
Note how the variance depends on first calculating the average.
As an example, if the user specifies 4 numbers and then enters 1.0, 1.5, 2.5, and 3.0, then the
average is (1.0 + 1.5 + 2.5 + 3.0) / 4 = 2.0. The variance is
((1.0 - 2.0)2 + (1.5 - 2.0)2 + (2.5 - 2.0)2 + (3.0 - 2.0)2) / 3 = (1 + 0.25 +0.25 + 1) / 3 = 2.5/3 =
0.83333.
Hint: You can use an array to help store the numbers if you would like (although there is a more
mathy way to calculate the variance without having to store the numbers).
SAVE
AI-Generated Solution
info
AI-generated content may present inaccurate or offensive content that does not represent bartleby’s views.
bartleby
Unlock instant AI solutions
Tap the button
to generate a solution
to generate a solution
Click the button to generate
a solution
a solution
Knowledge Booster
Background pattern image
Similar questions
- Explain how do you put data into variables.arrow_forwardEXPLAIN the steps involved in saving a variable to memory.arrow_forward7 Select the value that is returned by the following expression. "abcd"[2:] Try to answer this question from your understanding and not typing the expression into the Python shell. It will help reinforce your understanding of basic Python expressions. Question 7 options: "ab" "bc" "cd" errorarrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Text book imageDatabase System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationText book imageStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONText book imageDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- Text book imageC How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONText book imageDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningText book imageProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education