[PDF] Java Programming: Test 1 10-Oct-2021 Time allowed:





Previous PDF Next PDF



Java-Interview-Questions.pdf Java-Interview-Questions.pdf

Java Interview Questions. 1 / 30. Chapter 1. Object Oriented Programming (OOP) Both implementations share some common characteristics but they differ in the ...



Teach Yourself Java in 21 Days

questions comfort in dark times). LL. For RKJP



DIGITAL NOTES ON JAVA PROGRAMMING (R20A0508) B.TECH II

Java classes to provide a solution to a given set ofrequirements. ➢ Able to develop applications using Applet AWT



Java programming exam questions and answers Java programming exam questions and answers

Java object-oriented programming exam questions and answers pdf. Java coding questions and answers. A) b 3) Multiple inheritance means (a) one class inheriting 



Introduction to Programming Using Java

program that asks the user some questions and outputs the user's responses to a file named “profile.txt”: public class CreateProfile { public static void ...



MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION

MODEL ANSWER. SUMMER - 2017 EXAMINATION. Subject: Java Programming. Subject Code: Page 7 / 29. 17515. Example: class SingleLevelInheritanceParent { int l 



K.S.R. COLLEGE OF ENGINEERING(Autonomous) Vision of the

As it relates to java programming recursion is the attribute that allows a method to call This is probably the most common question on String I have seen in ...



Java SE 11 Certification Questions Answered

Why is Oracle pushing the Oracle Certified Professional (OCP) level of certification? 6 What does the job role look like for a Java. Developer? 7 Are there 



MC5304/ Programming With JAVA MCA 2018-2019 St. Josephs

Java for the answer of this Java collection question. 14. How HashMap works ... Java programming language that dynamically receives requests and makes responses.



Extracting and answering why and why not questions about Java

Extracting and Answering Why and Why Not Questions about Java Program. •. 4:9 pdf. EISENBERG A. AND DE VOLDER



Java-Interview-Questions.pdf

2 General Questions about Java Why is Java called the Platform Independent Programming Language? ... Both implementations share some common.



Java Interview Questions - tutorialspoint

acquainted with the nature of questions you may encounter during your interview for the subject of Java Programming Language. As per my experience 



ICS45J Sample Exam Questions

To help you study for the midterm and final here are some questions from previous exams I gave in Java programming courses I've taught.



Question answering on introductory Java programming concepts

14-Mar-2021 answers from the online programming forum Stack Overflow. ... a fundamental inability to answers questions on Java programming concepts.



Introduction to Programming Using Java

Introduction to Programming Using Java is a free introductory computer programming For the first time the quality of the PDF approaches that.



MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION

answer. 6) In case of some questions credit may be given by judgement on part of when a java program is compiled an intermediate code called the.



Java Programming Question Bank With Answers [PDF] - m.central.edu

17-Jun-2022 If you ally craving such a referred Java Programming Question Bank With Answers books that will pay for you worth get the totally best ...



ADVANCED JAVA PROGRAMMING QP CODE: 765 SUBJECT

(Each question carries 2 marks Answer any FIVE (5) questions. Servlet is a program written in Java that runs on a web server in response to the.



Java Programming: Test 1

10-Oct-2021 Time allowed: 90 minutes. • Answer all the questions. There are 50 marks in total. • Write your answers in this test paper and hand in all ...



Java Programming-22412 Question Bank

Java Programming-22412. Question Bank. UNIT – I - BASIC SYNTACTICAL CONSTRUCTS IN JAVA (10 Marks). 1. Explain any four features of java programming.



[PDF] Java-Interview-Questionspdf

In this guide we will discuss about different types of questions that can be used in a Java interview in order for the employer to test your skills in Java 



(PDF) java interview questions and answers - Academiaedu

learn some of the quertions to expect in a java interviews



Top 65 Java Interview Questions and Answers 2023 (With PDF)

1 déc 2022 · Find the comprehensive guide to Java interview questions and answers for both freshers and experienced professionals



Java Programming Exercises With Solutions (PDF) - CsTutorialpoint

5 avr 2023 · Here you will get Java Programming Exercises With Solutions (PDF) Java Programming Practical Assignments Questions and Solutions PDFs 



Top 1000+ Java Interview Questions and Answers Pdf - 1 - MeritNotes

Top 1000+ Java Interview Questions and Answers Pdf - 1 · Question: 1 Does Java support pointers? · Question: 2 What are wrapped classes? · Question: 3 What is 



100+ Java Interview Questions and Answers (2023) - Guru99

18 mar 2023 · Here are Java interview questions and answers for fresher as well as experienced candidates to get their dream job



[PDF] Java Interview Questions - tutorialspoint

What do you know about Java? Java is a high-level programming language originally developed by Sun Microsystems and released in 1995 Java runs on a variety of 



[PDF] ICS45J Sample Exam Questions

ICS45J Sample Exam Questions To help you study for the midterm and final here are some questions from previous exams I gave in Java programming courses 



Latest 60 Java Interview Questions And Answers Pdf

Latest 60 Java Interview Questions And Answers Pdf 1 What is the right data type to represent a price in Java? Answer: BigDecimal if memory is not a 



Java Programming Questions and Answers - IndiaBIX

Java Programming questions and answers with explanations are provided for your competitive exams placement interviews and entrance tests

:
Family Name:..............................Other Names:............................. Student ID:................................Signature..................................

Java Programming: Test 1

2016, Oct 10

Instructions

Time allowed:90 minutes

Answerallthe questions. There are 50 marks in total. Write your answers in this test paper and hand in all sheets. If you think some question is unclear, ask for clarification. Brief Java documentation is provided with the test

This test contributes 10% of your final grade

(But your mark will be increased to your exam mark if that is higher.)

You may use dictionaries.

You may write notes and working on this paper, but make sure your answers are clear.

Questions Marks

1. Programs with variables [11]2. Programs with text input and output [7]

3. Programs with Strings [6]

4. Programs with graphical output [12]

5. Programs with objects [9]

6. Programs with methods and parameters [5]

TOTAL:

Student ID: .......................

SPARE PAGE FOR EXTRA ANSWERS

Cross out rough working that you do not want marked. Specify the question number for work that you do want marked.

Java Programming (Terms Test 1)Page2of12

Student ID: .......................

Question 1.

Programs with variables [11 marks]

(a)[5 marks] What will the followingprintStumethod print out if the user types the values5and11in response to the questions? public voidprintStu ()f doubleabc = UI.askDouble("First number:"); doubledef = UI.askDouble("Secnd number:");

UI. println (abc);

UI. println ("not "+ def);

doubleghi = abcdef;

UI. println (abc +" plus "+ def +" makes "+ ghi);

g Note: the first two lines with the questions are shown already.First number:5 Secnd number:11Java Programming (Terms Test 1)Page3of12

Student ID: .......................

(b)[6 marks] What will the followingprintValuesmethod print out? x:y: z:public voidprintValues()f doublex = 50; doubley = 20; doublez = x + y;

UI. println ("z is "+ z);

x = y; y = x;

UI. println ("x is "+ x);

UI. println ("y is "+ y);

z = z + y;

UI. println ("z is "+ z);

z = xz;

UI. println ("z is "+ z);

gz is

Java Programming (Terms Test 1)Page4of12

Student ID: .......................

Question 2.

Programs with text input and output [7 marks]

Complete the followingcalculateCylindermethod that will ask the user for the height and radius of a cylinder and then print out the volume of the cylinder(2pr2h). You may use the value 3.14159 or the constantMath.PIin your method.public voidcalculateCylinder ()fg

Java Programming (Terms Test 1)Page5of12

Student ID: .......................

Question 3.

Programs with Strings [6 marks]

You may need to refer to theStringclass on the documentation page for this question. What will the followingprocessWordsmethod print out if the user gives the answer "Ping

Yang Li" to the question?

public voidprocessWords()f

Stringplace = UI.askString("Where do you live");

UI. println ("One: "+ place);

UI. println ("Two: "+ place.length());

Stringloc = place.toUpperCase();

UI. println ("Three: "+ loc);

place = place + place;

UI. println ("Four: "+ place);

Stringmid = place.substring (0,4);

UI. println ("Five: "+ mid);

mid = place.substring (5,11);

UI. println ("Six: "+ mid);

gWhere do you live: Ping Yang Li One: Two:

Three:

Four: Five:

Six:Java Programming (Terms Test 1)Page6of12

Student ID: .......................

Question 4.

Programs with graphical output [12 marks]

(a)[5 marks]Sketch what the followingdrawIt()method will draw in the graphics pane, if the user types 100 when asked for the size? public static naldoublewidth = 50; public voiddrawIt()f doublesize = UI.askDouble("Enter the size:");

UI.drawRect(250, 150, width, size );

UI. llOval (150, 50, size , width);

UI.drawLine(width, size , width, 2size );

g* MENU *

100 200300 400

100
200
300
50
150
250

50 150250 350

Enter the size: 100Extra copy (in case you made a mistake): * MENU *

100 200300 400

100
200
300
50
150
250

50 150250 350

Enter the size: 100Java Programming (Terms Test 1)Page7of12

Student ID: .......................

(b)[7 marks] Complete the followingdrawSign()method so that it draws the following sign in the UI window.drawSignshould Ask the user for the center of the sign (x and y) and the diameter. Compute values of theleft,top, andrightof the sign, and put them in variables.

Set the line width to be 1/10 of the diameter,

Draw the sign, using the variables.public voiddrawSign()fg

Java Programming (Terms Test 1)Page8of12

Student ID: .......................

Question 5.

Programs with objects [9 marks]

A turtle robot is a small mobile robot with a pen that can be "off" or "on". The robot can move around on a large sheet of paper. If its pen is "on", then it will leave a line on the paper as it moves; if its pen is "off", then it moves without leaving a line. TheTurtleRobotclass defines simulated turtle robots. It has a constructor and four methods.

Here is the documentation:/Constructor:/

TurtleRobot(ColorpenColor)g

// Creates a new TurtleRobot at the center of the window, facing to the right . // The parameter specifies the color of the robot"s pen. // The pen is initially '' off "". /Methods:/ voidpenO() // Lift the pen up, so it won"t leave a line . voidpenOn() // Put the pen down, so it will leave a line . voidforward(doubledistance) // Move forward by the specified distance . // Leave a line of the turtle "s color if the pen is on voidturn(doubleangle) // Change the direction of the turtle by the specified angle (in degrees ).

// Positive angle turns to the right ; Negative angle turns to the left .Complete the followingtestTurtlesmethod to test the TurtleRobot class. It should

Create a turtle robot with a green pen.

Make the robot draw a line 30 units long from the center towards the right of the win- dow.

Create another turtle robot with a red pen.

Make the second robot draw a line 40 units long from the center towards the top of the window. Make the first robot draw a dashed line towards the top of the window (- - -) where each dash is 10 units long and the spaces between are 5 units long. Make the second robot move to the same position as the first robot, without drawing a line.a) turtle #1 c) turtle #1d) turtle #2 b) turtle #2 start both turtles end here Java Programming (Terms Test 1)Page9of12

Student ID: .......................

public voidtestTurtles ()fg

Java Programming (Terms Test 1)Page10of12

Student ID: .......................

Question 6.

Programs with Methods and Parameters [5 marks]

The followingfancyTurtles()method makes a collection ofTurtleRobots draw some shapes on the window. It uses thefancy(TurtleRobot t, double ang, double distance)method that is also given below. In the box, sketch whatfancyTurtles()will draw on the window. (You may use any empty space to draw it if you get it wrong the first time. public voidfancyTurtles()f

TurtleRobot t1 =newTurtleRobot(Color.blue);

this.fancy(t1, 45, 50);

TurtleRobot t2 =newTurtleRobot(Color.red);

this.fancy(t2,120, 20); this.fancy(t2, 120, 40); this.fancy(t1, 0, 40); this.fancy(t1,90, 10); g public voidfancy(TurtleRobot t,doubleang,doubledist)f t.penOn(); t.turn(ang); t.move(dist); t.turn(ang); t.move(dist); t.turn(ang); t.move(dist); t.turn(3ang); t.penO(); t.move(10); g (Question 6 continued on next page)

Java Programming (Terms Test 1)Page11of12

Student ID: .......................

(Question 6 continued)start Extra copy (in case you made a mistake):start * * * * * * * * * * * * * * *

Java Programming (Terms Test 1)Page12of12

quotesdbs_dbs21.pdfusesText_27
[PDF] java programming syllabus pdf

[PDF] java programs on arrays and strings

[PDF] java programs on strings and arrays

[PDF] java programs to practice

[PDF] java projects to practice

[PDF] java questions asked in interview

[PDF] java ring ppt presentation download

[PDF] java se 11 books

[PDF] java se 11 pdf download

[PDF] java send http get request example

[PDF] java series program examples

[PDF] java sort(comparator)

[PDF] java spring @componentscan example

[PDF] java spring boot componentscan

[PDF] java spring componentscan annotation