9/30/2012

BCS1233 AD : Pseudocode Exercise

There are two most commonly algorithm used to describe process ; flowchart and pseudocode ( pronounce as -′süd·ō′kōd ).  Consider the following problems and learn how the pseudocode is constructed.

1. Write a pseudocode to find the perimeter and area of a rectangle
The perimeter and area of the rectangle are given by the following formulas:
  perimeter = 2 * (length + width)
  area = length * width

1.PROMPT user to enter length and width
2.READ length and width
3. CALCULATE perimeter and area
       perimeter = 2 * (length + width)
       area = length * width
4. OUTPUT perimeter and area


2. Write a pseudocode which inputs a length in inches, and outputs its equivalent in centimeters (1 inch = 2.54 centimeters)

1.PROMPT user to enter inch
2.READ inch
3. CONVERT inch into centimeters
      centimeters = inch * 2.54
4. OUTPUT centimeters

 Now, its your turn -write a pseudocode for the following problems.

1.(Converting feet into meters) Write a program that reads a number in feet, converts it to meters, and displays the result. One foot is 0.305 meters.


2.*(Calculating tips) Write a program that reads the subtotal and the gratuity rate, and computes the gratuity and total. For example, if the user enters 10 for subtotal and 15% for gratuity rate, the program displays $1.5 as gratuity and $11.5 as total.

3.*(Payroll) Write a program that reads the following information and prints a payroll statement:
Employee's name (e.g., Smith)

Number of hours worked in a week (e.g., 10)

Hourly pay rate (e.g., 6.75)

Federal tax withholding rate (e.g., 20%)

State tax withholding rate (e.g., 9%)



A sample run of a program is shown in below:-



The level of difficulty is rated as easy (no star), moderate (*), hard (**), or challenging (***).

9/29/2012

INSERT, DELETE, UPDATE AND SELECT Data in MS-Access with VB 2008

Pelajar tahun akhir kursus IT/Sains Komputer/Networking/CIS yang mengambil 'FYP' (Final Year Project), sebahagian besarnya akan membina sistem maklumat. Antara proses yang wajib ada dalam suatu sistem maklumat ialah proses tambah, padam dan  kemaskini data.
'interface' program


Bagi pelajar yang membina sistem dengan menggunakan bahasa Visual Basic. Di sini saya lampirkan 'link' dari http://setha.info/home.html. Projek berkenaan menggunakan Visual Studio 2008 dengan Ms Access 2007 sebagai database.


INSERT, DELETE, UPDATE AND SELECT Data in MS-Access with VB 2008

9/25/2012

Programming 1 : Assignment 2


PART A
1. Fill in the third column in the following tables:
expression1
expression2
expression1 || expression2
false
false

false
true

true
false

true
true


expression1
expression2
expression1 && expression2
false
false

false
true

true
false

true
true


 
PART B
1. Write a program to output even numbers 1 to 20 using three types of loop statement (while, do-while and for) in three seperate program.


2. Write a program that input a grade. If the grade is less than 0 or greater than 100, your program should print the appropriate message informing the user that an invalid grade has been entered.


2.1               PSEUDOCODE




2.2              FLOWCHART

 

2.3         C++ PROGRAM


 
3         Write a program that input ten (10) integers. Print out the sum of those integers.

3.1               PSEUDOCODE




3.2               FLOWCHART



 


3.3         C++ PROGRAM





Due date : 9 / 10 /2012

BCS2233OOP first calculation program


1. (Computing the volume of a cylinder) Write a program that reads in the radius and length of a cylinder and computes volume using the following formulas:-
area = radius x radius x PI
volume = area x length

PI=3.14159

import java.util.Scanner;
/**
 * @(#)Welcome.java
 *
 * Welcome application
 *
 * @author
 * @version 1.00 2012/9/25
 */

public class Welcome {
 
    public static void main(String[] args) {
   Scanner input = new Scanner(System.in);
System.out.println("Enter a num for radius");
double radius = input.nextDouble();

System.out.println("Enter a num for length");
double length = input.nextDouble();


double area,volume;
        area = radius * radius * 3.14159;
        volume = area * length;

        System.out.println( volume);

    }
}

9/18/2012

DCT1033 Control Statement -Repetitively

DCT1033 EI dan MT masuk pada bab Repetitively / Looping.
 Dalam bahasa melayunya di sebut Ulangan.  Kebanyakan proses penyelesaian masalah (berkomputer) memerlukan kepada proses ulangan. Contoh Baca markah 70 pelajar dan kira purata. 

Sebelum melangkah kepada masalah yang lebih rumit - mari kukuhkan dulu asas Looping. 


Masalah 1 - Draw a flowchart for a program to print 1 to 50.




 Masalah 2 - Draw a flowchart for a program to print 10 to 30. (yg berubah berbanding Masalah 1 di warnakan oren)


Masalah 3-Draw a flowchart for a program to print 30 down to 10. (Perhatikan perubahan warna hijau yang di buat)


 Masalah 4 - Draw a flowchart for a program to read 50 integers and calculate the sum.
(menggunapakai Flowchart Masalah 1, perhatikan tambahan teks dan simbol warna unggu)


Programm C++ untuk soalan 1,2 dan 4 adalah spt berikut
 

BCS1223 Flowchart Exercise 19 Sept 12


1.(Converting feet into meters) Write a program that reads a number in feet, converts it to meters, and displays the result. One foot is 0.305 meters.



2.*(Calculating tips) Write a program that reads the subtotal and the gratuity rate, and computes the gratuity and total. For example, if the user enters 10 for subtotal and 15% for gratuity rate, the program displays $1.5 as gratuity and $11.5 as total.

3.*(Payroll) Write a program that reads the following information and prints a payroll statement:
Employee's name (e.g., Smith)

Number of hours worked in a week (e.g., 10)

Hourly pay rate (e.g., 6.75)

Federal tax withholding rate (e.g., 20%)

State tax withholding rate (e.g., 9%)



A sample run of a program is shown in below:-



The level of difficulty is rated as easy (no star), moderate (*), hard (**), or challenging (***).

Related posts:-

BCS1233 AD

9/16/2012

BCS1223 Flowchart Exercise 17 Sept 12

1.  (Computing the volume of a cylinder) Write a program that reads in the radius and length of a cylinder and computes volume using the following formulas:-

area = radius x radius x PI
volume = area x length

PI=3.14159

2. (Converting Celsius to Fahrenheit). Write a program that reads a Celsius, then converts it to Fahrenheit and displays the result. The formula for the conversion is as follows:


Fahrenheit = (9/5) x Celsius + 32


3. (Converting Pounds into Kilograms)Write a program that converts pounds into kilograms. The program prompts the user to enter a number in pounds, converts it to kilogram, and displays the result. One pound is 0.454 Kilograms

4. (Finding the number of minutes and  hours) Write a program that prompts the users to enter a number of seconds (e.g 1000000) and displays the equivalent numbers of hours and equivalents numbers of minutes.
Here is a sample run:
Enter the number of seconds :1000000
1000000 seconds = 16666.67 minutes
1000000 seconds = 277.78 hours



Related post(s)

BCS1233 AD

9/11/2012

BCS1233 AD

}Design a flowchart to find the perimeter and area of a rectangle
}The perimeter and area of the rectangle are given by the following formulas:
  perimeter = 2 * (length + width)
  area = length * width

 Draw a flowchart which inputs a length in inches, and outputs its equivalent in centimeters (1 inch = 2.54 centimeters) 



Quiz 2 19/9/2012 (Selection)

Quiz 2 akan di buat pada 19/9/2012.
Topik: Selection
Contoh soalan adalah sebagaimana latihan yang di buat di kelas 12/9/2012




Saya akan masuk chapter 4 Control Structure II (Repetition) pada kelas 19/9/12. Di minta pelajar baca dulu untuk dapat gambaran awal. 

9/01/2012

BCS2233 OOP (Bahan Kuliah)


Saya akan mengendalikan subjek Object Oriented Programming untuk pelajar :-
2 BCBM dan 1 BCNS semester 1 2012/2013.

Kelas adalah pada :- 
Ahad jam 11.00 - 1.00 (L15) dan Selasa 2:00-5.00 (ITLAB 2).


Berikut adalah bahan-bahan pengajaran bagi subjek berkenaan:-

1) 'Lesson Plan' / Rancangan Pengajaran :- BCBM dan BCNS

2) Buku Rujukan Y. Daniel Liang, Introduction to Java™ Programming, Brief Version, 8 Edition. 2011. Pearson Education. 


3) 'Power point slide' bagi buku di atas boleh di dapati dari link di bawah:-


Chapter 1 Introduction to Computers, Programs, and Java (download)
Chapter 2 Elementary Programming (download)
Chapter 3 Selections (download)
Chapter 4 Loops (download)
Chapter 5 Methods (download)
Chapter 6 Arrays (download)
Chapter 7 Multidimensional Arrays (download)
Chapter 8 Objects and Classes (download)
Chapter 9 Strings and Text I/O (download)
Chapter 10 Thinking in Objects (download)
Chapter 11 Inheritance and Polymorphism (download)
Chapter 12 GUI Basics (download)
Chapter 13 Exception Handling (download)

4. Perisian
JDK , Jcreator

Bagi membangunkan aplikasi java dalam pc masing2. Pelajar perlu melakukan 'installation' java, dan perkara dibawah perlu di lakukan:-


1. Install JDK. http://java.sun.com/javase/downloads/index.jsp












2. Install JCreator (salah satu IDE utk java). http://www.jcreator.org/download.htm





Tutorial untuk java boleh di dapati dari link di bawah.
http://download.oracle.com/docs/cd/E17409_01/javase/tutorial/index.html 

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.  ...