Conditional STMT Tasks
Conditional STMT Tasks
//theory mark and practical mark both are true, which means print paper 1 pass with marks if
anyone fails, it means print fail to reason with marks.
package first;
public class Task1
{
public static void main(String[] args)
{
// Declare and assign theory and practical marks
int theoryMark = 55;
int practicalMark = 35;
// Set the passing criteria for both theory and practical exams
int passingMarkTheory = 40;
int passingMarkPractical = 20;
else {
System.out.println("Fail due to Practical Marks: " + practicalMark);
}
}
}
TASK 02:
//declare money=10/0-nothing 2 buy earn money first if u have this much of amount print what u
buy->return bal amount<- 10-100, 100-500, 500-1000, 1000-5000, 5000-10000, >10000
package first;
public class ShoppingTask
{
public static void main(String[] args)
{
// Initial balance set to zero
int money = 1240;