CS-521 Homework 3

$30.00

Download Details:

  • Name: CS_521_hw_3-6wvgzl.zip
  • Type: zip
  • Size: 285.57 KB

Category:

Description

Rate this product

Complete the following problems from the textbook: 4.1, 4.3 (pages 120-121); 5.1, 5.3 (pages 158-
160); 8.1 (page 263); 13.1 (page 471).
Enter an integer, the input ends if it is 0: 0
The number of positives is 3
The number of negatives is 1
The total is 5
The average is 1.25
Enber
Enter an integer, the input ends if it is 0: 0
You didn’t enter any number
Enter
Sections 5.2-5.7
*5.1 (Count positive and negative numbers and compute the average of numbers)
Write a program that reads an unspecified number of integers, determines
how many positive and negative values have been read, and computes the total
and average of the input values (not counting zeros). Your program ends with the
input 0. Display the average as a floating-point number. Here is a sample run:
Enter an integer, the input ends if it is 0: 1 Enter
Enter an integer, the input ends if it is 0: 2
Enter an integer, the input ends if it is 0: -1
Enter
Enter
Enter an integer, the input ends if it is 0: 3
Enter
*4.3 (Algebra: solve 2 x 2 linear equations) You can use Cramer’s rule to solve the
following 2 × 2 system of linear equation:
ax + by =e ed-bf af-ec y= cx+ dy = f
ad-bc ad-bc
Write a program that prompts the user to enter a, b, c, d, e, and f and display the
result. If ad – bc is 0, report that The equation has no solution.
Enter a, b, c, d, e, f: 9.0, 4.0, 3.0, -5.0,-6.0, -21.0
x is -2.0 and y is 3.0
Enter
Enter a, b, c, d, e, f: 1.0, 2.0, 2.0, 4.0, 4.0, 5.0
The equation has no solution
Enter
Where to submit?
Click Assignments in the Navigation Area and then click on the title of the assignment to enter the
submission area and upload your response.