5/01/2018

BCS2233 OOP. Assignment III

Design a class named Account that contains:

       I.           A private int data field named id for the account (default 0).
     II.           A private double data field named balance for the account (default 0).
    III.           A private double data field named annualInterestRate that stores the cur-rent interest rate (default 0). Assume all accounts have the same interest rate.
   IV.           A private Date data field named dateCreated that stores the date when the account was created.
     V.           A no-arg constructor that creates a default account.
   VI.           A constructor that creates an account with the specified id and initial balance.
  VII.           The accessor and mutator methods for id,balance, and annualInterestRate.
 VIII.           The accessor method for dateCreated.
   IX.           A method named getMonthlyInterestRate() that returns the monthly interest rate.
     X.           A method named getMonthlyInterest() that returns the monthly interest.
   XI.           A method named withdraw that withdraws a specified amount from the account.
  XII.           A method named deposit that deposits a specified amount to the account.

Draw the UML diagram for the class and then implement the class.
(Hint: The  methodgetMonthlyInterest() is to return monthly interest, not the interest rate. Monthly interest is balance*monthlyInterestRate.monthlyInterestRate isannualInterestRate/12. Note that annualInterestRate is a percentage, e.g., like 4.5%. You need to divide it by 100.). Write a test program that creates an Account object with an account ID of 1122, a balance of $20,000, and an annual interest rate of 4.5%. Use the withdraw method to withdraw $2,500, use the deposit method to deposit $3,000, and print  the balance, the monthly interest, and the date when this account was created.

4/24/2018

BCS2233 OOP. Lab 25 April 2018

Give both Structured and Object Oriented solution for the following problems.

 1.    Write a java program that reads the length and height of a rectangle and computes its area and parameter using the following formulas:-
Area = length x height
Perimeter = 2 x (length + height)

Structured: https://drive.google.com/file/d/0BxDLK8tlx2V1dEo0MGRRY3FLcmM/view?usp=sharing


2.    Write a java program that reads the height of a cube  and computes its area and parameter using the following formulas:-
Area = height2
Perimeter = 4 x height

Structured: https://drive.google.com/file/d/0BxDLK8tlx2V1MzM4SERjQkctLUk/view?usp=sharing



3.    Write a program that reads in the radius and length of a cylinder and computes its volume using the following formulas:

Area = radius * radius * 3.14
Volume = area * length


4/22/2018

DCT2023 DS & FP. Lab Linked Lists. (#2)

1. Write a program in C++ to insert a new node at the beginning of a Singly Linked List.
Test Data :
Input the number of nodes : 3
Input data for node 1 : 5
Input data for node 2 : 6
Input data for node 3 : 7
 

Expected Output :
 Data entered in the list :                                                                                  
 Data = 5                                                                                                    
 Data = 6                                                                                                    
 Data = 7 


Solution (you may use your own solution)









































2. Write a program in C++ to create a singly linked list of n nodes and count the number of nodes. 
Test Data :
Input the number of nodes : 3
Input data for node 1 : 5
Input data for node 2 : 6
Input data for node 3 : 7
Expected Output :
 Data entered in the list are :                                                                              
 Data = 5                                                                                                    
 Data = 6                                                                                                    
 Data = 7                                                                                                    
                                                                                                             
 Total number of nodes = 3  


3. Write a program in C++ to insert a new node at the end of a Singly Linked List.
Test Data and Expected Output :

Input the number of nodes : 3                                                                                
 Input data for node 1 : 5                                                                                    
 Input data for node 2 : 6                                                                                    
 Input data for node 3 : 7                                                                                    
                                                                                                              
 Data entered in the list are :                                                                               
 Data = 5                                                                                                     
 Data = 6                                                                                                     
 Data = 7                                                                                                     
                                                                                                              
 Input data to insert at the end of the list : 8                                                              
                                                                                                              
 Data, after inserted in the list are :                                                                       
 Data = 5                                                                                                     
 Data = 6                                                                                                     
 Data = 7 
 Data = 8 
 
4. Write a program in C++ to insert a new node at the middle of Singly Linked List. 

Test Data and Expected Output : 
Input the number of nodes (3 or more) : 4                                                                    
 Input data for node 1 : 1                                                                                    
 Input data for node 2 : 2                                                                                    
 Input data for node 3 : 3                                                                                    
 Input data for node 4 : 4                                                                                    
                                                                                                              
 Data entered in the list are :                                                                               
 Data = 1                                                                                                     
 Data = 2                                                                                                     
 Data = 3                                                                                                     
 Data = 4                                                                                                     
                                                                                                              
 Input data to insert in the middle of the list : 5                                                           
 Input the position to insert new node : 3                                                                    
                                                                                                              
 Insertion completed successfully.                                                                             
                                                                                                              
 The new list are :                                                                                           
 Data = 1                                                                                                     
 Data = 2                                                                                                     
 Data = 5                                                                                                     
 Data = 3                                                                                                     
 Data = 4 
 
5. Write a program in C++ to delete first node of Singly Linked List. 

Test Data : 

Input the number of nodes : 3 

Input data for node 1 : 2 

Input data for node 2 : 3 

Input data for node 3 : 4 

Expected Output : 
 Data entered in the list are :                                                                               
 Data = 2                                                                                                     
 Data = 3                                                                                                     
 Data = 4                                                                                                     
                                                                                                              
 Data of node 1 which is being deleted is :  2                                                                
                                                                                                              
 Data, after deletion of first node :                                                                         
 Data = 3                                                                                                     
 Data = 4 
 
6. Write a program in C++ to delete a node from the middle of Singly Linked List. 

Test Data and Expected Output : 
Input the number of nodes : 3                                                                                
 Input data for node 1 : 2                                                                                    
 Input data for node 2 : 5                                                                                    
 Input data for node 3 : 8                                                                                    
                                                                                                              
 Data entered in the list are :                                                                               
 Data = 2                                                                                                     
 Data = 5                                                                                                     
 Data = 8                                                                                                     
                                                                                                              
 Input the position of node to delete : 2                                                                     
                                                                                                              
 Deletion completed successfully.                                                                             
                                                                                                              
 The new list are  :                                                                                          
 Data = 2                                                                                                     
 Data = 8 
 
7. Write a program in C++ to delete the last node of Singly Linked List. 

Test Data : 

Input the number of nodes : 3 

Input data for node 1 : 1 

Input data for node 2 : 2 

Input data for node 3 : 3

Expected Output : 
 Data entered in the list are :                                                                               
 Data = 1                                                                                                     
 Data = 2                                                                                                     
 Data = 3                                                                                                     
                                                                                                              
 The new list after deletion the last node are  :                                                             
 Data = 1                                                                                                     
 Data = 2 
 
8. Write a program in C++ to search an existing element in a singly linked list. 
Test Data and Expected Output : 
Input the number of nodes : 3                                                                                
                                                                                                              
 Input data for node 1 : 2                                                                                    
 Input data for node 2 : 5                                                                                    
 Input data for node 3 : 8                                                                                    
                                                                                                              
 Data entered in the list are :                                                                               
 Data = 2                                                                                                     
 Data = 5                                                                                                     
 Data = 8                                                                                                     
                                                                                                              
 Input the element to be searched : 5                                                                         
 Element found at node 2 
 

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