Write a program called checkpass

Assignment Help JAVA Programming
Reference no: EM131596708

Q1. which of the following is syntactically incorrect? and Why?

int x = 5, y = x; String m1 = "ABc", m2 = m1; String m3 = new String("AbC");
a. if( x.equals(y) )

b. if( m1=m2)

c. if( m2==m3 )

d. if ( x==y )

e. if( m1=null )

f. if( m1.equals(m3) )

g. If( m1.equals(m2)


Q2. What is the output of following questions.

A.int x 5, y 0, z -2;

if(x<0 SS (y<2 II z>2) )
System. out .println("A");
else if(x>0 (y<2 II z>2))
System. out sprintln("8"):
else if(x>0 && (y<2 && z>2))
System. out .println("C");

System.out.println("D");

B.

int x = -1, y = 3, z = -2;
if(x<0 && (y<2 II z>2) )
System. out .print("A");
else if(x>0 && (y<2 II z>2))
System. out .print("8");
else if(x>0 it (y<2 && z>2))
System. out. print("C");
System.out.println("D");

C.

int i;
int sum=o; for(i=0; i<5 ;i++)
{
if(i>1)
sum=sum+i;
}
System.out.println("Sum is " + sum); System.out.println("last value of i is + i);

Q2.1

if(x>0)
{
if (y<O)
if(z==y)
System. out.println("A");
}
}
else
System.out.println("B");

Q2.2. Given the code:

what is the output in each of the following cases? a. x=6, y=0, z=0
b. x=2, y=-1, z=-2

c. x=-1, y=-2, z=-2

d. x=0, y=-2, z=-2

e. x=3, y=-1, z=-1

Q3.Convert the following for loop into a while loop.

int sum = 0;
for (int i = 10; i > 10; i--) sum = sum + I;

Q4. Write a program called CheckPass which read the mark from user in double and prints "PASS" if the mark is more than or equal to 60; or prints "FAIL" otherwise.

Reference no: EM131596708

Questions Cloud

Discuss the different types of graphics and formatting : Discuss the different types of graphics and formatting that can be added to a Microsoft Word document.
Six sigma and acceptance sampling : Using the Six Sigma Approach (DMAIC), provide an example situation that utilizes the five-step plan, and determine three to four (3-4) challenges.
Explain the erp systems mitigate risk : Using scholarly material, explain how Enterprise Resource Planning (ERP) Systems mitigate risk and assist in organizational decision making.
Consumer and shareholder protection : You are tasked with writing a blog post discussing Facebook's stance on consumer privacy in the digital age.
Write a program called checkpass : IT401 – Assignment - Write a program called CheckPass which read the mark from user in double and prints "PASS" if the mark is more than or equal to 60
Describe individual rights for a patient regarding emr : Discuss at least two (2) individual rights for a patient regarding EMR and their healthcare information. Next, describe three (3) basic safeguards.
Component to improving coding practices : How important is it to have education for physicians since they are a critical component to improving coding practices?
Sustainable development and the environment : You have been appointed as the new environmental manager for Microsoft.
Ehr implementation at community medical center : This is your first day on the job as Assistant Director in the HIM department at Community Medical Center (CMC). You meet with the HIM Director.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Write a very simple data maintenance java program

In this assignment, you will write a very simple data maintenance Java program for a small computer retail store (like Staples).

  Disadvantages to using data structures

How are data structures managed and organized in this language. How does the management or syntax of data structures in this language differ from how data structures are handled in other language.

  Calculate the maximum data rate in mb/second

b)How much cylinder skew is needed for an Oceangate disk operating at 20,000 rpm(new series for the Christmas promotions) which has a seek time of 0.5 milliseconds? This disk has 800 sectors of 512 bytes each on each track.

  Create an array of five employee objects

Create an array of five Employee objects. Prompt the user to enter data for each Employee. Do not allow duplicate ID numbers to be entered.

  Exceptions-memory management and concurrency

This question asks you to compare properties of exceptions in C++ and Java.

  Draw the result of taking the tree in the diagram

Draw the result of taking the tree in the diagram and deleting the root three times using the deletion algorithm from lecture and the web

  Write a program to test your class myrectangle.

Compile and run your program until it works and the output looks nice. Add the necessary documentation as described in Course Documents, and then attach your .java file to this assignment. Do not attach the .class file, attach only the .java sourc..

  Java program which performs the following

Write a Java program which performs the following: - Reads 25 integers into a 5 by 5 2-D array called R.

  Implement a sorting algorithm for inclusion in a package

Prepare a targeted plan in which you present your detailed strategies to recruit and select 20 Engineers to hire (full-time or part-time) within 8 months - Implement a sorting algorithm for inclusion in a package for a lucrative client.

  Discuss a website that utilizes json

A website that utilizes JSON. Review the website source, and evaluate how the author created the pages - Identify what you liked or did not like

  Create an application in which a user can enter a phone book

Create an application in which a user can enter a phone book entry, including the subsequent elements: First Name, Last Name, Phone Number, email address

  Java provides three repetitions structures

Java provides three repetitions structures: while, do while and for. These statements are also known as loops. When would you use a looping statement?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd