introduction to java programming

19
Introduction to java programming 1 st lab 1 Afnan Al-Hindi

Upload: halima

Post on 16-Feb-2016

33 views

Category:

Documents


0 download

DESCRIPTION

Introduction to java programming. 1 st lab. Rules. Csc111 course has (3 hours lecture+1 hour Tutorial +2 hours Lab). You should check our announcements at our blog many times every day http://csc111java1.wordpress.com / - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Introduction to java programming

1

Introduction to java programming

1st lab

Afnan Al-Hindi

Page 2: Introduction to java programming

2

1. Csc111 course has (3 hours lecture+1 hour Tutorial +2 hours Lab).

2. You should check our announcements at our blog many times every day http://csc111java1.wordpress.com/

3. We will upload a sheet every week to print it ,read it , prepare it and understand it very well then we will evaluate you by 1 question randomly during lab time.

Rules

Afnan Al-Hindi

Page 3: Introduction to java programming

3

1. Make sure that you attend on your lab as your schedule on time.

2. Make sure you attend on time on your right lab because at the beginning of each lab we will check attendance of all students.

3. At the beginning of each lab you can ask TA if you have any question about sheet.

4. Make sure that you don’t leave the lab until you finish your programming code and until your TA evaluate your code.

Attendance & evaluation

Afnan Al-Hindi

Page 4: Introduction to java programming

4

* You should submit your sheet to your TA in the beginning of your lab time (any late will not be accepted for any reason)

* Make sure that you submit the (hard copy +soft copy of your solution) <<if you forget any one of them then your sheet will not be corrected.

hard copy: print (you code+ sample run on paper)soft copy: save your java files on CD or floppy disk(any flash memory

will not accepted) * You should print cover page for each sheet * Don’t forget to write your full information on (cover page, top of your code and

at your CD\Floppy) Name:ID:Serial no # Sheet#Section#Your TA name:

* Any sheets will not be accepted if you put it under TA’s office door. * After we correct your sheets we will return it to you, then you have 1 week to

discuss your sheet’s grade with your TA.Afnan Al-Hindi

sheets

Page 5: Introduction to java programming

5

Your code should be very well organized . Your code should have comments to explain your code. Your file should have a right name. Your sheet is an individually assignment, so you should

solve it alone . Make sure that cheating is not allowed for any course

and first of all it is forbidden. If we discover any cheating between 2 students then

each 2 students will take -10 out of 10 We will not accept any late sheets for any reason If you want to be absent one day, send your sheet with

your friends or submit it before a day to your TA hand by hand with your medical report.

Afnan Al-Hindi

Code

Page 6: Introduction to java programming

6

Make sure that you go to your TA’s lab Check your TA’s office hours on her

schedule at office door. Don’t noise any body in the office , just

knock the door and go directly to your TA. Also, make sure that your question is about

sheets. If you have any question about your lecture

you can ask your lecturer.

Afnan Al-Hindi

When you want to ask your TA

Page 7: Introduction to java programming

Hanan Al-Hindi 7

1- Java Development Kit (JDK) (Non-Mac users)

2- jGRASP

You need to download:

Page 10: Introduction to java programming

Hanan Al-Hindi 10

Page 11: Introduction to java programming

Hanan Al-Hindi 11

Name of class is the same name of file

Page 12: Introduction to java programming

Hanan Al-Hindi 12

compile

Page 13: Introduction to java programming

Hanan Al-Hindi 13

Run

Page 14: Introduction to java programming

Example 1 Design an algorithm that converts a

Temperature from Celsius to Fahrenheit Given that F= 9/5*C+32

Page 15: Introduction to java programming

algorithm

1- get the temperature in Celsius.2- find the temperature in Fahrenheit using

the Fahrenheit = 9/5*Celsius+32.3- output the temperature in Fahrenheit.

Page 16: Introduction to java programming

Example 2

To make a profit, prices of the items sold in a book store are marked up 60%. Design an algorithm to find the selling price of an item sold at the book store.

Page 17: Introduction to java programming

algorithm

1- get the original price.2- calculate the selling price using the

formula selling price = original price + original price *0.60.

3- output the selling price.

Page 18: Introduction to java programming

Hanan Al-Hindi 18

Name: Afnan al-Hindi Email:[email protected]

Name: Maha al-Sayyari Email: [email protected]

Name: Malak al-Mojaly Email:[email protected]

Contact Information

Page 19: Introduction to java programming

19

Good luck with CSC111 course= )

Afnan Al-Hindi