Upcoming SlideShare
×

# Ann

525 views

Published on

Published in: Education, Technology
0 Likes
Statistics
Notes
• Full Name
Comment goes here.

Are you sure you want to Yes No
• Be the first to comment

• Be the first to like this

Views
Total views
525
On SlideShare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
15
0
Likes
0
Embeds 0
No embeds

No notes for slide

### Ann

1. 1. Universidad De Manila Antonio J. Villegas Street Mehan Garden Ermita, Manila College of Engineering and Technology Compilation of Exercises in Object Oriented Programming Submitted by: Estorninos, Rose Ann G. CO-41 Instructor: Engr. Elmerito D. Pineda
2. 2. EXERCISE #1 package javaapplication13 public class JavaApplication13 { public static void main(String[] args) { System.out.println("ttRESUMEn"); System.out.println("tPERSONAL DATA:n"); System.out.println("Rose Ann G. Estorninos"); System.out.println("2314 Gapan St. Gag. Tondo,Manila"); System.out.println("09129694078"); System.out.println("roseannestorninos@yahoo.com"); System.out.println("nObjective: To obtain a position in a stable work enviroment with growth potential."); System.out.println("ntEDUCATIONAL BACKGROUND:n"); System.out.println("Primary: Gregoria De Jesus Elementary Schooln"); System.out.println("Secondary: Jose P. Laurel High Schooln"); System.out.println("Tertiary: Universidad De Manila") }} EXERCISE#2
3. 3. package javaapplication14; importjava.util.Scanner; public class JavaApplication14 { public static void main(String[] args) { Scanner epal = new Scanner (System.in); float grade; System.out.println("input your grade:"); grade = epal.nextFloat(); if ((grade<=100)&&(grade>=75)) { System.out.println("Pass"); } else if ((grade<75)&&(grade>=50)) { System.out.println("Fail"); } else { System.out.println("Input Error!"); } } } EXERCISE #3
4. 4. package javaapplication19; importjava.util.Scanner; public class JavaApplication19 { public static void main(String[] args) { Scanner input = new Scanner( System.out.println("Quiz #1:"); //quizzes int q1 = input.nextInt(); System.out.println("Quiz #2:"); int q2 = input.nextInt(); System.out.println("Quiz #3:"); int q3 = input.nextInt(); doubleavgm = (q1 + q2 + q3) / 3; System.out.println("Midterm Exam:"); // midterm exam intmidterme = input.nextInt(); doublemidtermg = (midterme*0.6)+(avgm*0.4); //midterm grade System.out.println("Quiz #4:"); int q4 = input.nextInt(); System.out.println("Quiz #5:"); int q5 = input.nextInt(); doubleavgf = (q4 + q5) / 2; System.out.println("Final Exam:"); //Final exam intfinalse = input.nextInt(); doublefinalsg = (finalse*0.6)+(avgf*0.4); doublefg = (finalsg*0.6)+(midtermg*.4); System.out.println("Your Midterm grade is: " + midtermg);
5. 5. System.out.println("Your Finals grade is : " + finalsg); System.out.println("Your Final grade is : " + fg);}} EXERCISE #4 package javaapplication15; importjavax.swing.JOptionPane; public class JavaApplication15 { public static void main(String[] args) { String name; String msg; name = JOptionPane.showInputDialog("Enter Your Name:"); msg = "Hello " + name + "!!"; JOptionPane.showMessageDialog(null, msg); } }