0% found this document useful (0 votes)
5 views1 page

Java RealTime Applications

The document outlines two Java console applications: a Student Grade Management System and a Shopping Bill Calculator. The Student Grade Management System processes student details and marks to calculate average grades and results, while the Shopping Bill Calculator computes total costs, discounts, and final bills based on item prices and quantities. Both applications utilize command-line arguments, arrays, and control statements for their functionalities.

Uploaded by

smitabm
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views1 page

Java RealTime Applications

The document outlines two Java console applications: a Student Grade Management System and a Shopping Bill Calculator. The Student Grade Management System processes student details and marks to calculate average grades and results, while the Shopping Bill Calculator computes total costs, discounts, and final bills based on item prices and quantities. Both applications utilize command-line arguments, arrays, and control statements for their functionalities.

Uploaded by

smitabm
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

REAL-TIME JAVA APPLICATIONS

1. Student Grade Management System

Problem Definition:
Develop a Java console application for a Student Grade Management System that accepts student
details and marks through command-line arguments, processes the data using arrays, applies
operators and control statements to calculate results, determine grades, and print a detailed
performance report.

Java Program:
public class StudentGradeSystem { public static void main(String[] args) { if
([Link] < 5) { [Link]("Usage: java StudentGradeSystem <StudentName>
<Math> <Science> <English> <Computer>"); return; } String studentName = args[0];
double math = [Link](args[1]); double science =
[Link](args[2]); double english = [Link](args[3]); double
computer = [Link](args[4]); double[] marks = {math, science, english,
computer}; String[] subjects = {"Math", "Science", "English", "Computer"}; double
total = 0; for (int i = 0; i < [Link]; i++) { total += marks[i]; } double
average = total / [Link]; char grade; if (average >= 90) grade = 'A'; else if
(average >= 75) grade = 'B'; else if (average >= 60) grade = 'C'; else if (average
>= 40) grade = 'D'; else grade = 'F'; String result = (average >= 40) ? "PASS" :
"FAIL"; [Link]("Student: " + studentName); [Link]("Average:
" + average); [Link]("Grade: " + grade); [Link]("Result: " +
result); } }

2. Shopping Bill Calculator

Problem Definition:
Create a Shopping Bill Calculator in Java that accepts item prices and quantities as command-line
arguments, stores them in arrays, and calculates the total amount, discount, and final payable bill
using operators, control statements, and loops.

Java Program:
public class ShoppingBillCalculator { public static void main(String[] args) { if
([Link] < 7) { [Link]("Usage: java ShoppingBillCalculator
<CustomerName> <item1Price> <item1Qty> " + "<item2Price> <item2Qty> <item3Price>
<item3Qty>"); return; } String name = args[0]; double item1Price =
[Link](args[1]); int item1Qty = [Link](args[2]); double
item2Price = [Link](args[3]); int item2Qty = [Link](args[4]);
double item3Price = [Link](args[5]); int item3Qty =
[Link](args[6]); double[] prices = {item1Price, item2Price, item3Price};
int[] qty = {item1Qty, item2Qty, item3Qty}; double total = 0; for (int i = 0; i <
[Link]; i++) { total += prices[i] * qty[i]; } double discount = (total >
1000) ? total * 0.1 : (total > 500 ? total * 0.05 : 0); double finalAmount = total -
discount; [Link]("Customer: " + name); [Link]("Total: ■" +
total); [Link]("Discount: ■" + discount); [Link]("Final
Amount: ■" + finalAmount); } }

You might also like