Skip to content

Commit e745a5d

Browse files
committed
new
1 parent 6c4ca11 commit e745a5d

File tree

3 files changed

+12
-13
lines changed

3 files changed

+12
-13
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Computer Project for Class XII ISC
22
## Description
3-
This project contains 20 programs with full documentation for class 12 ISC project.
3+
This project contains 20 programs with full documentation for the Class XII ISC project.
44
All programs were made with OpenJDK JDK 18.0.1 in IntelliJ IDEA in April 2022.
5-
This project will help you get an idea about the difficulty level of Class XII ISC computer exam
6-
and will also guide you onn how to write a program with proper documentation.
7-
Note: Some features like enhanced for, enhanced switch and text blocks have not been used as they
5+
This project will help you get an idea about the difficulty level of the Class XII ISC computer exam
6+
and will also guide you on how to write a program with proper documentation.
7+
Note: Some features like enhanced for, enhanced switch, and text blocks have not been used as they
88
fall out of the syllabus for class XII ISC.
99
## Table of Contents
1010
* AlphabeticalSentence
Binary file not shown.

src/com/sbiswas001/twelveproject/AlphabeticalSentence.java

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ private void input() {
2828
Scanner sc = new Scanner(System.in);
2929
System.out.print("Enter number of strings: ");
3030
//Deals with InputMismatchException
31-
if(!sc.hasNextInt()){
31+
if(!sc.hasNextInt()) {
3232
System.out.print("Wrong input! Enter a number: ");
3333
input();
3434
}
35-
int x=Integer.parseInt(sc.next());
35+
int x = Integer.parseInt(sc.next());
3636
s = new String[x];
3737
System.out.print("Enter the strings: ");
3838
for (int i = 0; i < x; i++) {
@@ -47,10 +47,10 @@ private void input() {
4747
private void compute(String[] a) {
4848
String temp;
4949
//Bubble sort technique
50-
for (int i = 0; i < a.length; i++) {
51-
for (int j = i + 1; j < a.length; j++) {
52-
if (a[i].toUpperCase().
53-
compareTo(a[j].toUpperCase())>0) {
50+
for(int i = 0; i < a.length; i++) {
51+
for(int j = i + 1; j < a.length; j++) {
52+
if(a[i].toUpperCase().
53+
compareTo(a[j].toUpperCase()) > 0) {
5454
temp = a[i];
5555
a[i] = a[j];
5656
a[j] = temp;
@@ -63,9 +63,8 @@ private void compute(String[] a) {
6363
* Displays the sorted strings
6464
*/
6565
private void display() {
66-
67-
for(int i=0; i<s.length; i++) {
68-
System.out.print(s[i]+" ");
66+
for(int i = 0; i < s.length; i++) {
67+
System.out.print(s[i] + " ");
6968
}
7069
}
7170

0 commit comments

Comments
 (0)