Computer Science

posted by .

I need help with these assignments.


"Write a program to read a list of exam scores (integers in the range 0 to 100) and to output the total number of grades and the number of grades in each letter-grade category (90 to 100 = A, 80 to 89 = B, 70 to 79 = C, 60 to 69 = D, and 0 to 59 = F). The end of the input is indicated by a negative score as a sentinel value. (The negative value is used only to end the loop, so do not use it in the calculations.) For example, if the input is
98
87
86
85
85
78
73
72
72
72
70
66
63
50
-1

The output would be
Total number of grades=14
Number of A’s=1
Number of B’s=4
Number of C’s=6
Number of D’s=2
Number of F’s=1"


"Write a Rectangle class.
This class represents Rectangles. Each Rectange has the X and Y coordinates of its center point (as doubles) and its width and height (as double values, too). No other values should be stored! This means no area, no perimeter!

The class should have the following constructors and methods:
1. a constructor that takes X, Y, width, and height as arguments;
2. a constructor that takes only width and height as arguments;
3. a default constructor;
4. a method setCenter that takes X and Y as arguments;
5. a method setWidth that takes a width value;
6. a method setHeight that takes a height value;
7. a method getX that returns the X coordinate;
8. a method getY that returns the Y coordinate;
9. a method getWidth that returns the width value;
10. a method getHeight that returns the height value;
11. a method getArea calculates the area of the rectangle and returns it;
12. a method getPerimeter it calculates the perimeter of the rectangle and returns it;
13. a method toString that creates a String that includes the X, Y center coordinates, width, and height, and returns the string. This method does not use System.out.println() itself. It returns a String value to the caller.


Write an application (RectangleTest.java) to test your Rectangle class.
Your Application should test all the constructors and methods."

  • Computer Science -

    a constructor that takes X, Y, width, and height as arguments;
    : 2. a constructor that takes only width and height as arguments;
    : 3. a default constructor;
    : 4. a method setCenter that takes X and Y as arguments;
    : 5. a method setWidth that takes a width value;
    : 6. a method setHeight that takes a height value;
    : 7. a method getX that returns the X coordinate;
    : 8. a method getY that returns the Y coordinate;
    : 9. a method getWidth that returns the width value;
    : 10. a method getHeight that returns the height value;
    : 11. a method getArea calculates the area of the rectangle and
    : returns it;
    : 12. a method getPerimeter it calculates the perimeter of the
    : rectangle and returns it;
    : 13. a method toString that creates a String that includes the X, Y
    : center coordinates, width, and height, and returns the string. This
    : method does not use System.out.println() itself. It returns a String
    : value to the caller.
    :
    :
    : Write an application (RectangleTest.java) to test your Rectangle
    : class.
    : Your Application should test all the constructors and methods."
    :
    :
    : "Write a program to read a list of exam scores (integers in the
    : range 0 to 100) and to output the total number of grades and the
    : number of grades in each letter-grade category (90 to 100 = A, 80 to
    : 89 = B, 70 to 79 = C, 60 to 69 = D, and 0 to 59 = F). The end of the
    : input is indicated by a negative score as a sentinel value. (The
    : negative value is used only to end the loop, so do not use it in the
    : calculations.) For example, if the input is
    : 98
    : 87
    : 86
    : 85
    : 85
    : 78
    : 73
    : 72
    : 72
    : 72
    : 70
    : 66
    : 63
    : 50
    : -1
    :
    : The output would be
    : Total number of grades=14
    : Number of A’s=1
    : Number of B’s=4
    : Number of C’s=6
    : Number of D’s=2
    : Number of F’s=1"

Respond to this Question

First Name
School Subject
Your Answer

Similar Questions

  1. Java Help

    I am just starting out in programming. If someone could help me with these assignments, it would be greatly appreciated. "Write a Rectangle class. This class represents Rectangles. Each Rectange has the X and Y coordinates of its center …
  2. Intro to Computer Programming - Pseudocode

    This assignment (below) jumped way ahead of my abilities compared to the last assignment. I think I need a parallel array or a 2D array, an accumulator or loop counter, a verification of input, and Boolean something. But I'm not sure …
  3. algebra (i need help calculating my grade)

    i have exams tomorrow and i would like to figure out what i need to make on my exam to pass, daily grades are 30% major grades are 70% i averaged my daily grades to 84.5 my major grades so far are 77,85,91 what do i do next to figure …
  4. Computer Science

    1.Write an Assembly program that reads in a number of cents. The program will write out the number of dollars and cents separately. Sample Run: ?
  5. My First Quarter Grades (PLEASE READ!!!!)

    What is my grades for the first quarter? I didn't get my report card because my parents didn't go to the parents teacher conference so yeah but today my guides counselor show it to me (my grades for the first quarter) they didn't calculated
  6. computer science

    Write an Assembly program to determine the price of a car rental. The car being rented costs $45 per day and frequent renters get a $15 discount on the total bill. Get as input, the number of days rented and whether the user is part …
  7. Statistics

    Exam Grades. A statistics professor is used to having a variance in his class grades of no more than 100. He feels that his current group of students is different, and so he examines a random sample of midterm grades (listed below.) …
  8. visual basic programming

    Write a Visual Basic program that will calculate the assessment marks of a student taking the Computer Programming subject in College. The program must be able to determine the total result and finally display the grade of that student. …
  9. C++programming

    Write an interactive C program that will accept each student’s name an exam grades as input, determine an average grade for each student, and then display the student’s name, the individual exam grades and the calculated average. …
  10. algebra

    Need help in solving this To receive an A grade, a student must average 100 or less but more than 93. If Zane received an A in the course and had five grades of 95, 92, 98, 76, and 100 before taking the final exam, what were the possible …

More Similar Questions