Tasks - Conditional Statements #5
Replies: 39 comments
-
|
Write a program to find whether a given year is a leap year or not. public class LeapYear { }` Write a program to read the value of an integer m and display the value of n as 1 when m is larger than 0, 0 when m is 0, and -1 when m is less than 0. public class Dependent { WAP to find the largest and smallest of three numbers. public class LargestSmallest { }` WAP to accept a coordinate point in an XY coordinate system and determine in which quadrant the coordinate point lies. public class Quadrant { }` WAP to accept the marks of a student in Phy, Chem, and Maths. Calculate the total marks and the grade. public class Grade { WAP to take 3 sides of a triangle as input and find out if it is Equilateral, Isosceles, or Scalene. public class Triangle { WAP to take a single-digit positive number as input and print it in words. public class NumToWord { |
Beta Was this translation helpful? Give feedback.
-
` } `
` }
` } `
public class detectQuadrant { } `
} `
} `
` public class printWord { } ` |
Beta Was this translation helpful? Give feedback.
-
leap year`import java.util.Scanner; public class Leap { } Value of N`import java.util.Scanner; public class ValueOfN { } Max and Min of 3`import java.util.Scanner; public class MaxnMin { }` Coordinate Points`import java.util.Scanner; public class Quads { Student Grade`import java.util.Scanner; public class Student { Triangles`import java.util.Scanner; public class Triangle { } Number in Words`import java.util.Scanner; public class NumInWords { |
Beta Was this translation helpful? Give feedback.
-
|
Write a program to find whether a given year is a leap year or not. public class Leapyear { public class DisplayN { } public class LargestAndSmallest { } public class Coordinate { } public class Marks { } public class Triangle { public class PrintNumber { }` |
Beta Was this translation helpful? Give feedback.
-
|
` public class LeapYear { } Write a program to read the value of an integer m and display the value of n as 1 when m is larger than 0, 0 when m is 0, and -1 when m is less than 0. public class Values { WAP to find the largest and smallest of three numbers. public class LargestSmallest { } WAP to accept a coordinate point in an XY coordinate system and determine in which quadrant the coordinate point lies. public class Quadrant { } WAP to accept the marks of a student in Phy, Chem, and Maths. Calculate the total marks and the grade. public class Grades { } WAP to take 3 sides of a triangle as input and find out if it is Equilateral, Isosceles, or Scalene. public class Triangle { } WAP to take a single-digit positive number as input and print it in words. public class NumberToWords { } ` |
Beta Was this translation helpful? Give feedback.
-
|
task 1 leap year: `import java.util.Scanner; public class LeapYear { } Task 2- `public class ValueOfN { } Task 3: ` } ` Task 4: ` } ` ` } ` ` } Task 7: ` } ` |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
|
`TASK1: } TASK2: public class Task2 { } TASK3: } TASK4: } TASK5: } TASK6: } TASK7: import java.util.*; } |
Beta Was this translation helpful? Give feedback.
-
|
Task 1: Leap Year Task 2: Round Off Integers. Task3: Largest and Smallest of Three Numbers Task 4: Find Quadrant Task 5: Marks and Grades Task 6: Find Type of Triangle Task 7: Digit to Word |
Beta Was this translation helpful? Give feedback.
-
|
Write a program to find whether a given year is a leap year or not. public class IsLeapYear { Write a program to read the value of an integer m and display the value of n as 1 when m is larger than 0, 0 when m is 0, and -1 when m is less than 0. public class DisplayNvalue { } WAP to find the largest and smallest of three numbers. public class LargestAndSmallestOfThreeNumbers { } WAP to accept a coordinate point in an XY coordinate system and determine in which quadrant the coordinate point lies. WAP to accept the marks of a student in Phy, Chem, and Maths. Calculate the total marks and the grade. public class StudentGrade { } WAP to take 3 sides of a triangle as input and find out if it is Equilateral, Isosceles, or Scalene. public class TypesOfTriangles { WAP to take a single-digit positive number as input and print it in words. public class DigitInWord { } |
Beta Was this translation helpful? Give feedback.
-
|
Question 1 public class Leap { } Question 2 public class Value { Question 3 public class MaxMin { } Question 4 public class Quadrant { } Question 5 public class Grade { } Question 6 public class Triangle { } Question 7 public class NumWord { |
Beta Was this translation helpful? Give feedback.
-
|
` package task4; //Second package task4; //third package task4; //fourth package task4; } //fifth package task4; //sixth package task4; //seventh package task4; import java.util.Scanner; public class Spelling { } ` |
Beta Was this translation helpful? Give feedback.
-
|
proggg1 public class prog1{ } prog 2 public class prog2 { } prog 3 public class prog3 { } prog 4 public class prog4 { } prog 5 } prog 6 } prog7 } |
Beta Was this translation helpful? Give feedback.
-
|
`import java.util.*; } import java.util.*; } import java.util.*; } public class coordinates { public class gradingSystem { } public class triangle { } import java.util.*; |
Beta Was this translation helpful? Give feedback.
-
|
1.Write a program to find whether a given year is a leap year or not. public class Leap { } public class Number { } public class Largest { } `import java.util.Scanner; public class Quadrants { } `import java.util.Scanner; public class Student { } `import java.util.Scanner; public class Traingle { } `import java.util.Scanner; public class Word { } |
Beta Was this translation helpful? Give feedback.
-
|
1. Leap Year `public class LeapYear { static boolean isLeapYear(int year) { 2. printing 0,1, -1 according to m import java.io.*; 3. Largest and smallest of three numbers import java.io.*; 4. determining in which quadrant the coordinate point lies import java.io.*; 5. marks of a student in Phy, Chem, and Maths. Calculate the total marks and the grade import java.io.*; 6. take 3 sides of a triangle as input and find out if it is Equilateral, Isosceles, or Scalene import java.io.*; 7. Take a single-digit positive number as input and print it in words import java.io.*; `` |
Beta Was this translation helpful? Give feedback.
-
|
Write a program to find whether a given year is a leap year or not. public class leapYear { } } Write a program to read the value of an integer m and display the value of n as 1 when m is larger than 0, 0 when m is 0, and -1 when m is less than 0. } WAP to find the largest and smallest of three numbers. public class largeSmall { } WAP to accept a coordinate point in an XY coordinate system and determine in which quadrant the coordinate point lies. public class Coordinate { } WAP to accept the marks of a student in Phy, Chem, and Maths. Calculate the total marks and the grade. public class gradeMarks { } WAP to take 3 sides of a triangle as input and find out if it is Equilateral, Isosceles, or Scalene. public class Triangle { } WAP to take a single-digit positive number as input and print it in words. public class NumWord { |
Beta Was this translation helpful? Give feedback.
-
|
Write a program to find whether a given year is a leap year or not. public class Leapyear { } Write a program to read the value of an integer m and display the value of n as 1 when m is larger than 0, 0 when m is 0, and -1 when m is less than 0. } WAP to find the largest of three numbers. } WAP to accept a coordinate point in an XY coordinate system and determine in which quadrant the coordinate point lies. import java.util.Scanner; } WAP to accept the marks of a student in Phy, Chem, and Maths. Calculate the total marks and the grade. public class SumPercentage { } WAP to take 3 sides of a triangle as input and find out if it is Equilateral, Isosceles, or Scalene. } WAP to take a single-digit positive number as input and print it in words. } |
Beta Was this translation helpful? Give feedback.
-
Write a program to find whether a given year is a leap year or not.import java.util.*; class Findleap { } Write a program to read the value of an integer m and display the value of n as 1 when m is larger than 0, 0 when m is 0, and -1 when m is less than 0.import java.util.*; class Task22 { } WAP to find the largest and smallest of three numbers.import java.util.*; class Task3 { } WAP to accept a coordinate point in an XY coordinate system and determine in which quadrant the coordinate point lies.import java.util.*; class Task4 { } WAP to accept the marks of a student in Phy, Chem, and Maths. Calculate the total marks and the grade.import java.util.*; class Task5 { } WAP to take 3 sides of a triangle as input and find out if it is Equilateral, Isosceles, or Scalene.import java.util.*; class Task6 { } WAP to take a single-digit positive number as input and print it in words.import java.util.*; class Task7 { } |
Beta Was this translation helpful? Give feedback.
-
|
`Write a program to find whether a given year is a leap year or not public class LeapYear { } To read the value of an integer m and display the value of n as 1 when m is larger than 0, 0 when m is 0, and -1 when m is less than 0 import java.util.*; public class DisplayValue { } largest and smallest of three numbers public class MinMax { } WAP to take 3 sides of a triangle as input and find out if it is Equilateral, Isosceles, or Scalene import java.util.*; public class Tiangle { } Take a single-digit positive number as input and print it in words import java.util.*; public class NumToWord { } ` |
Beta Was this translation helpful? Give feedback.
-
|
Write a program to find whether a given year is a leap year or not. import java.util.*; } Write a program to read the value of an integer m and display the value of n as 1 when m is larger than 0, 0 when m is 0, and -1 when m is less than 0. import java.util.*; } WAP to find the largest and smallest of three numbers. import java.util.*; } WAP to accept a coordinate point in an XY coordinate system and determine in which quadrant the coordinate point lies. import java.util.*; } WAP to accept the marks of a student in Phy, Chem, and Maths. Calculate the total marks and the grade. import java.util.*; } WAP to take 3 sides of a triangle as input and find out if it is Equilateral, Isosceles, or Scalene. import java.util.*; WAP to take a single-digit positive number as input and print it in words. import java.util.*; public class printWord { } |
Beta Was this translation helpful? Give feedback.
-
Task 1`import java.util.Scanner; public class LeapYear { }` Task 2`import java.util.Scanner; public class MNDependency { } Task 3`import java.util.Scanner; public class LargestAndSmallest { } Task 4`import java.util.Scanner; import javax.lang.model.util.ElementScanner14; public class DeterQuadrant { } Task 5`import java.util.Scanner; import javax.lang.model.util.ElementScanner14; public class StudentMarksGrade { } Task 6`import java.util.Scanner; import javax.lang.model.util.ElementScanner14; public class TriangleType { } Task 7`import java.util.Scanner; public class PrintNumInWords { } |
Beta Was this translation helpful? Give feedback.
-
|
Write a program to find whether a given year is a leap year or not. Write a program to read the value of an integer m and display the value of n as 1 when m is larger than 0, 0 when m is 0, and -1 when m is less than 0. WAP to find the largest and smallest of three numbers. WAP to accept a coordinate point in an XY coordinate system and determine in which quadrant the coordinate point lies. WAP to accept the marks of a student in Phy, Chem, and Maths. Calculate the total marks and the grade. WAP to take 3 sides of a triangle as input and find out if it is Equilateral, Isosceles, or Scalene. WAP to take a single-digit positive number as input and print it in words. |
Beta Was this translation helpful? Give feedback.
-
2.MN 3.Smallest Largest
5.Grades
|
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Code1import java.util.Scanner;
public class LeapYear {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("Enter the Year");
int year = Integer.parseInt(sc.next());
if(year %4 ==0 && year % 100!=0 || year % 400 == 0) {
System.out.println("year is leap year");
}else {
System.out.println("year is not a leap year");
}
}
} |
Beta Was this translation helpful? Give feedback.
-
Code1public class A {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int year = scan.nextInt();
if(year%4==0 || year%400==0 && year%100!=0) {
System.out.println("Leap Year");
}else {
System.out.println("not leap");
}
}
} |
Beta Was this translation helpful? Give feedback.
-
Code2import java.util.Scanner;
public class mn {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("Enter the value of m:");{
int m = Integer.parseInt(sc.next());
int n;
if(m>0) {
n=1;
}else if(m==0) {
n=0;
}else {
n=-1;
}
System.out.println("the value of n is:"+ n);
}
}
} |
Beta Was this translation helpful? Give feedback.
-
Code2import java.util.Scanner;
public class Mn {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int m = scan.nextInt();
int n;
if (m>0) {
n=1;
}else if (m==0) {
n=0;
}else {
n=-1;
}
System.out.println(n);
}
} |
Beta Was this translation helpful? Give feedback.
-
Code3import java.util.Scanner;
public class Mn {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int a = scan.nextInt();
int b = scan.nextInt();
int c = scan.nextInt();
int x = (a>b) ? ((a > c) ? a : c): ((b > c) ? b : c);
int y = (a<b) ? ((a < c) ? a : c): ((b < c) ? b : c);
System.out.printf("the largest number in %d ,%d ,%d is %d",a,b,c,x);
System.out.println();
System.out.printf("the smallest number in %d ,%d ,%d is %d",a,b,c,y);
}
} |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Write a program to find whether a given year is a leap year or not.
Write a program to read the value of an integer m and display the value of n as 1 when m is larger than 0, 0 when m is 0, and -1 when m is less than 0.
WAP to find the largest and smallest of three numbers.
WAP to accept a coordinate point in an XY coordinate system and determine in which quadrant the coordinate point lies.
WAP to accept the marks of a student in Phy, Chem, and Maths. Calculate the total marks and the grade.
WAP to take 3 sides of a triangle as input and find out if it is Equilateral, Isosceles, or Scalene.
WAP to take a single-digit positive number as input and print it in words.
Beta Was this translation helpful? Give feedback.
All reactions