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

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

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