- Write method headers for the following methods:
- Computing a sales commission, given the sales amount and the commission rate.
- Printing the calendar for a month, given the month and year.
- Computing a square root.
- Testing whether a number is even, and returning true if it is.
- Printing a message a specified number of times.
- Computing the monthly payment, given the loan amount, number of years, and annual interest rate.
- Finding the corresponding uppercase letter, given a lowercase letter.
3/31/2013
BCS1243 PP : Chapter 5 Method
Exercise
3/30/2013
BCS1333 : CPU SCHEDULING EXERCISE
Consider
the following table 1. Four processes are arrived at time 0, with the length of
the CPU burst given in milliseconds:
Process Burst Time _______
* Priority
P1 15 3
P2 10 1
P3 3 3
P4 5 2
*smaller
priority number implies a higher priority
Table1 List of processes that are
arrived at time 0
The processes are assumed to have
arrives in order P1,P2,P3,P4 all at time 0.
II.
What
is the waiting time of each process of the scheduling algorithms in part I.?
3/17/2013
BCS1243 PP: Contoh Test 1
A. Response to the following statements by
circling either T (TRUE) or F (FALSE). [10M]
I.
1. Java enables users to develop and
deploy applications on the Internet for servers, desktop computers, and small
hand-held devices.( T / F)
II.
2. Java is one of language that support
object oriented programming. ( T / F)
IV.
3. Reserved words or keywords are
words that have a specific meaning to the compiler and cannot be used for other
purposes in the program. ( T / F)
I.
5. An identifier is a sequence of
characters that consist of letters, digits, underscores (_), and dollar signs
($).( T / F)
B. Match the following Statement / Name to its description.
No
|
Statements
|
|
Description
|
I.
|
x = 1;
|
|
Constants
|
II.
|
int x = 1;
|
|
Addition
|
III.
|
double radius;
|
|
Declaring and Initializing
|
IV.
|
final int SIZE = 3;
|
|
Multiplication
|
V.
|
+
|
|
Assignment Statements
|
VI.
|
*
|
|
Remainder
|
VII.
|
%
|
|
Declaring Variables
|
C. Answer the following questions
I.
What is debugging? [2 marks]
II.
What is the difference between a constant and
a variable? [2 marks]
D. Which of the following are invalid identifiers,
why? [7 marks]
I.
one
II.
hello_there
III.
hello,there
IV.
my Window
V.
JAVA
VI.
1234
VII.
acct122
E. Evaluate the following expressions:
[4 marks]
I.
10 + 2 / 2
II.
3 * 3 + 3 % 2
III.
3 + 2 / 5 + -2 * 4
IV.
2 * (1 + -(3/4) / 2) * (2 - 6 % 3)
F. Write a java fragment for the
following problems.
0.
Write a for statement to print integer 1 to
20. [example]
int I;
For (i=1; i<=10; i++)
System.out.Println(i);
I.
Write a for statement to print integer 50 to
60. (3 marks)
II.
Write a for statement to print the following
output. (3 marks)
2
4 6 8 10
Subscribe to:
Posts (Atom)
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. ...
-
ANSWERS TO CHAPTER EXERCISES (CHAPTER 8) Review Questions 1. List and describe various types of output, including technolog...
-
Based on real life scenario on any local company/ organization which you are very familiar, define the problem that could be addressed thr...
-
A. Response to the following statements by circling either T (TRUE) or F (FALSE). [10M] I. 1. Java enables users...