11/05/2012

BCS 2233 OOP Assignment 2


1. You are required to provide (i) Algorithm (Flowchart or  Pseudocode)  and (ii) Java program for each of the following problems.

I. Write a program for finding the sum of first 100 even numbers starting from 0.

II. Read 10 integers and find the total of even number and odd number entered.

III. Read 10 integers and find the total of positive number and negative number.

IV. Write a program that prompts the user to enter the number of students and each student's name and score, and finally displays the student with the highest score.




2. Write method headers for the following methods:
  1. Computing a sales commission, given the sales amount and the commission rate.
  2. Printing the calendar for a month, given the month and year.
  3. Computing a square root.
  4. Testing whether a number is even, and returning true if it is.
  5. Printing a message a specified number of times.
  6. Computing the monthly payment, given the loan amount, number of years, and annual interest rate.
  7. Finding the corresponding uppercase letter, given a lowercase letter.
3.
(Converting an uppercase letter to lowercase) Write a method that converts an uppercase letter to a lowercase letter. Use the following method header:
public static char upperCaseToLowerCase(char ch)
4.
(Computing commissions) Write a method that computes the commission, using the following rate table . The header of the method is:
public static double computeCommission(double salesAmount)

Sales Amount                      Commission Rate
$0.01–$5,000                        8 percent
$5,000.01–$10,000             10 percent
$10,000.01 and above        12 percent

No comments:

Cara download Installer windows 10 dalam format ISO

1. Jika anda bercadang untuk download windows 10 melalui website rasmi windows - pilihan untuk download dalam format ISO tidak di berikan.  ...