11/21/2010
BCS2143 TEST 1 SOLUTIONS
http://nazri.webng.com/BCS2143/Mid_Term_BCS2143_SOLUTION.docx
updated on 28/11/2010 3:47 pm
11/15/2010
BCT 1113 Solution for Assignment 3 (no 2 and 3)
* c*Note: code C++ tidak dapat di pamirkan dengan betul di sini.
2. 2. Write a function named CalSAP ( short for Calculate Sum, Average and Product) that have three arguments, prints the sum, the average and product. The function calling should be as follows
CalSAP (13,27,14);
and the following output should be displayed by function CalSAP.
Sum is 54
Average is 18
Product is 4914
Solutions
void kira(int a, int b, int c)
{
int sum, pro;
double avg;
sum = a+b+c;
pro=a*b*c;
avg=sum/3.0;
cout<<”Sum is “ <
cout<<”Average is “ <
cout<<”Product is “ <
}
2. 3. Write a function named mutlak that computes and return the absolute difference of its two arguments, where the absolute difference of A and B is A – B if A is greater than B and B –A if B is greater than A. The function calling should be as follows
cout<
and the following output should be displayed by function mutlak.
4
Solutions
int mutlak(int a, int b)
{
if(a>b) return (a-b);
if(b>a) return (b-a);
}
11/04/2010
BCS2143 Theory Of Computer Science
1 What is DECIDABILITY?
2 Give a proof of the following theorem:-
a) A DFA is a decidable language.
b) ANFA is a decidable language.
c) A REX is a decidable language.
d) E DFA is a decidable language.
e) Every context-free language is decidable. (refer to sipser page 172)
3. Draw a figure to describe the relationship among the four main classes of languages that we have described so far: regular, context free, decid-able, and Turing-recognizable. (refer to sipser page 173)
4. Answer all parts for the following DFA M and give reasons for your answers.
5. Let A ={
11/02/2010
BCS2234 Java Applet Lab Activities 3/11/2010
1. New power point slide for Java applet. Click here.
2. Exercise
Write an applet that writes your name using the drawString method. Embed a link to your applet in an HTML document and view it using a Web browser.
References / tutorials
1. visual and interactive aspects of applets
2. Complete references for
java.awt
Class Graphics
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...