Pre-defined data types and Input/Output in Java 1 of 3
Aim of the Portfolio
This Portfolio will help the students understand the concept of pre-defined data types in Java, be familiar with the input/output mechanism and demonstrate the understanding by writing program code using pre-defined data types, taking input from the user and producing outputs.
Learning Outcome(s) of the Portfolio
a) Identify and select appropriate pre-defined data types (1.a)
b) Use simple input/output and appropriate operators with the above (1.b)
c) Develop documentation for a pre-described program application (3.b)
Tasks:
Give BRIEF answers to the following:
1. Define the following programming terms: variable, constant, data type.
2. How is a String variable different from char variable?
3. What is the difference between short int and long int data types?
4. List some of the arithmetic, logical operations with example used in java programming.
Write the following Programs:
5. Write a Java program to perform basic arithmetic operations which are multiplication and division of two numbers. Numbers are assumed to be integers and will be entered by the user
6. That accepts the circle radius from a user, compute area and circumference. Formula Area= π r², circumference = 2* π r.
7. Asks the user to enter studentID, Name, Sex, Age, and Height in meters; Stores these in variables of appropriate data types and presents them together to the user. e.g.
StudentID:p1001215
Name: Vasu
Sex: M
Age: 32
Height: 1.65 meters
Reading Materials
1. Lecture notes available on STP Online
2. Introduction to Java Programming by Y. Daniel Liang (8th Edition)
Feedback
Strengths
Areas for Improvement
Lecturer Signature: