Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
5 views

Program

Programs

Uploaded by

mehaksoomro468
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Program

Programs

Uploaded by

mehaksoomro468
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 26

Program: 01

CV
package abdul.khalique.s.cv;

public class AbdulKhaliqueSCV {

public static void main(String[] args) {

System.out.println(" Name : Abdul Khalique ");

System.out.println("");

System.out.println(" About Me : I am a student of Bs in Computer Science


Professional Graphic Designer with 2+ years of experience ");

System.out.println(" developing and creating attrective designs


like 3D logo, templates, brushers, banners, animated vedios, ");

System.out.println(" and also a programing language learner I


learnt C++, Java, and Game Development course. ");

System.out.println("");

System.out.println(" Experience : RESEARCH GATE ");

System.out.println(" 2021/ till present Larkana ");

System.out.println(" I learnt Graphic Designing from Resaerch


Gate and also worked as professional designer for ");

System.out.println(" for 2 years there was Sir Farhan Ali Surahio


who give work about designing .");

System.out.println("");

System.out.println(" DOT COME INSTITUTE ");

System.out.println(" 2019/ 2021 Larkana ");

System.out.println(" Where I completed CIT Certificate where I


learnt MS Word, MS Execel, MS Power Point, ");

System.out.println(" MS Access and also Adobe Photoshop.");

System.out.println("");

System.out.println(" MEMON TYPING CENTER");

System.out.println(" 2021 / 2023 Larkana ");


System.out.println(" In that Institute I got improved my typing skill
now I can type page within 5 minutes.");

System.out.println("");

System.out.println(" Education : GOVT: BOYS COLLAGE LARKANA ");

System.out.println(" 2021 / 2023 I done my Intermidiate level ");

System.out.println("");

System.out.println(" UNIVERSITY OF LARAKANA ");

System.out.println(" 2023/ till present I am doing my BS in


Computer Science ");

System.out.println("");

System.out.println(" Skills : C++");

System.out.println(" Java ");

System.out.println(" Graphic Designig");

System.out.println(" Vedio Editing ");

System.out.println(" Office Work ");

System.out.println(" Typing");

System.out.println("");

System.out.println(" Contact NO : 03438280399");

System.out.println(" 03173857306");

System.out.println("");

System.out.println(" G-Mail Address : abdulkhaliquekhoso125@gmail.com");

}
Program: 02

MARKSHEET OF 10 SUUBJECTS

package abdul.khalique.s.marksheet;

import java.util.Scanner;

public class ABDULKHALIQUESMarksheet {

public static void main(String[] args) {

Scanner inp = new Scanner (System.in);

System.out.println(" ------------------");

System.out.println(" MARKSHEET");

System.out.println(" ------------------\n");

System.out.println("NAME : ABDUL KHALIQUE");

System.out.println("ROLL NO : 03\n");

System.out.println("ENTER YOUR ENGLISH MARKS :");

int sub1 = inp.nextInt();

System.out.println("ENTER YOUR MATH MARKS :");

int sub2 = inp.nextInt();

System.out.println("ENTER YOUR SINDHI MARKS :");

int sub3 = inp.nextInt();

System.out.println("ENTER YOUR URDU MARKS :");

int sub4 = inp.nextInt();


System.out.println("ENTER YOUR COMPUTER MARKS :");

int sub5 = inp.nextInt();

System.out.println("ENTER YOUR JAVA (OOP) MARKS :");

int sub6 = inp.nextInt();

System.out.println("ENTER YOUR PHYSICS MARKS :");

int sub7 = inp.nextInt();

System.out.println("ENTER YOUR CHEMISTRY MARKS :");

int sub8 = inp.nextInt();

System.out.println("ENTER YOUR BIOLOGY MARKS :");

int sub9 = inp.nextInt();

System.out.println("ENTER YOUR ISLAMIAT MARKS :");

int sub10 = inp.nextInt();

int total = sub1+sub2+sub3+sub4+sub5+sub6+sub7+sub8+sub9+sub10;

System.out.println("TOTAL :" + total );

float per = total*100/1000;

System.out.println("PERCENTAGE :" + per );

if (per >= 90 ) {

System.out.println("GRADE : A+");

} else if (per >= 80 ) {

System.out.println("GRADE : A");
} else if (per >= 70 ) {

System.out.println("GRADE : B");

} else if (per >= 60 ) {

System.out.println("GRADE : C");

} else if (per >= 50 ) {

System.out.println("GRADE : D");

} else {

System.out.println("FAIL");

}
Program: 03

SWAPPING WITH 3rd VARIABLE

package swapprogramwith3rdvariable;

public class SwapProgramWith3rdVariable {

public static void main(String[] args) {

// Swap Program With 3rd Variable

// Intializing The Variables

int a = 10;

int b = 20;

int c = 30;

a = c - a; // A become 20 (Original Value of B)

b = c - b; // B Become 10 (Original Value of A)

// After The Swapping

System.out.println(" After The Swapping A =" +(a));

System.out.println(" After The Swapping B =" +(b));

}
Program: 04

SWAPPING WITHOUT 3RD VARIABLE

package swap.program.without.pkg3rd.variable;

public class SwapProgramWithout3rdVariable {

public static void main(String[] args) {

// Swap Program without 3rd Varible

// Intailizing Variables

int a = 10 ;

int b = 20 ;

a = a + b; // a now becomes 30

b = a - b; // b becomes 10 ( Original Value of a )

a = a - b; // a becomes 20 ( Original Value of b )

// System.out.println(" After Swaping : a = " + a + ", b = " + b ); you may program write like
this or also like given below !!!

System.out.println(" After Swaping a = "+ (a));

System.out.println(" After Swaping b = " + (b) );

}
Program: 05

BUBBLE SORTING ASCENDING

package bubble.sortinng.ascending;

public class BubbleSortinngAscending {

public static void main(String[] args) {

int a [ ] = {5, 7, 8, 3, 9, 1};

System.out.println("BEFORE SORTIMG :");

for (int i = 0; i < a.length ; i++) {

System.out.println(a[i]);

System.out.println("AFTER SORTING :");

int temp;

for(int i=0; i<a.length; i++) {

for (int j=0; j<a.length-i-1; j++) {

if (a [ j ] > a [ j+1 ] ) {

temp = a [ j ] ;

a [ j ] = a [ j+1 ] ;

a [ j+1 ] = temp

for (int i=0; i<a.length; i++) {

System.out.println ( a [ i ] ) ;

}
Program: 06

BUBBLE SORTING DECENDING

package bubble.sorting.decending ;

public class BubbleSortingDecending {

public static void main(String[] args) {

int a [ ] = {5, 7, 8, 3, 9, 1};

System.out.println("BEFORE SORTIMG :");

for (int i = 0; i < a.length ; i++) {

System.out.println(a[i]);

System.out.println("AFTER SORTING :");

int temp;

for(int i=0; i<a.length; i++) {

for (int j=0; j<a.length-i-1; j++) {

if (a [ j ] < a [ j+1 ] ) {

temp = a [ j ] ;

a [ j ] = a [ j+1 ] ;

a [ j+1 ] = temp ;

for (int i=0; i<a.length; i++) {

System.out.println ( a [ i ] ) ;

}
Program: 07

STATICALLY LOOP TABLE

package statically.loop.table;

public class StaticallyLoopTable {

public static void main(String[] args) {

int number = 10;

System.out.println ( " TABLE OF " + number );

for ( int i =1 ; i <= 10 ; i++ ) {

System.out.println ( number + " * " + i + " = " + ( number * i ) )

}
Program: 08

DYNAMICALLY LOOP TABLE

package dynamical.loop.table;

import java.util.Scanner;

public class DynamicalLoopTable {

public static void main(String[] args) {

Scanner inp = new Scanner (System.in);

int tab, s , e;

System.out.println(" ENTER YOUR TABLE NUMBER : " );

tab = inp.nextInt();

System.out.println("ENTER START POINT : " );

s = inp.nextInt();

System.out.println(" ENTER END POINT : " );

e = inp.nextInt();

for (int i =s; i<=e; i++) {

System.out.println( tab + " * " + i + " = " +(tab * i) ) ;

}
Program: 09

SALARIES INCREAMENT
package salaries.increament.program;

import java . util . Scanner;

public class SalariesIncreamentProgram {

public static void main(String[] args) {

Scanner inp = new Scanner (System.in);

int Jawad = 6000;

int Irfan = 5000;

System.out.println("ENTER REMARK TO JAWAD ");

int Jaw = inp . nextInt () ;

System.out.println("ENTER REMARK TO IRFAN ");

int Irf = inp . nextInt () ;

if (Jaw < Irf) {

Jaw = Jaw + 1000;

System.out.println("JAWAD NEW SALARIES :" +Jaw);

}else{

Irf = Irf + 1000;

System.out.println("IRFAN NEW SALARIES :" +Irf);

}
Program: 10

LINEAR SEARCH

package linear.search.program;

public class LinearSearchProgram {

public static void main(String[] args) {

int arr [ ] = { 22, 33, 44, 55, 77, 88, 99 };

int key =88;

for ( int i = 0; i < arr . length; i++ ){

if ( arr [ i ] == key ) {

System.out.println(" VALUE FOUND AT INDEX : " + i + " VALUE IS " + arr [ i ] );

break;

} else if ( i >= arr.length-1 ){

System.out.println(" VALUE IS NOT FOUND ");

}
Program: 11

AGE CALCULATOR

package age.calculator;

import java.util.Scanner;

import java.time.*;

public class AgeCalculator {

public static void main(String[] args) {

Scanner inp=new Scanner (System.in);

LocalDate cd= LocalDate.now();

System.out.println(" ENTER Year, Month, Day ");

int y = inp . nextInt();

int m = inp . nextInt();

int d = inp . nextInt();

LocalDate bd = LocalDate .of (y,m,d);

int age = Period . between (cd, bd) .getYears ();

System.out.println("AGE :" +age);

}
Program: 12

DYNAMIC CALCULATOR

package dynamic.caculator;

import java . util . Scanner;

public class DynamicCaculator {

public static void main(String[] args) {

System.out.println("--------------------");

System.out.println("CALCULATOR");

System.out.println("--------------------");

int opratore , n1, n2;

int result = 0;

System.out.println( " 1. Addition \n2. Subtraction \n3. Multiplication \n4. Division \n5.
Module " );

System.out.println( " Choose Operatore " );

Scanner sc = new Scanner ( System . in );

opratore = sc . nextInt ( );

System.out.println( " ENTER YOUR FIRST NUM " );

n1 = sc . nextInt ( );

System.out.println( " ENTER YOUR SECOND NUM " ) ;

n2 = sc . nextInt ( );

switch ( opratore ) {
case 1 :

result = n1 + n2;

break;

case 2 :

result = n1 - n2;

break;

case 3 :

result = n1 * n2;

break;

case 4 :

result = n1 / n2;

break;

case 5 :

result = n1 % n2;

break;

default :

System.out.println( " ENTERED NUMBER IS NOT VAID " );

System.out.println( " RESULT IS " +result );

}
Program: 13

QUIZE GAME OF 5 QUESTIONS

package quize.of.pkg5.quetions;

import java.util.Scanner;

public class QUIZEOF5QUETIONS {

public static void main(String[] args) {

Scanner inp = new Scanner (System.in);

int score = 0;

int answer;

// QUESTION NO 1

System.out.println(" QUESTION NO 1 : WHICH PROGRAMMING LANGUAGE IS KNOWN FOR ITS


PLATEFORM INDEPENDENCE ? ");

System.out.println("1. JAVA \n2. PHTYON \n3. C++ \n4. JAVASCRIPT");

answer = inp . nextInt();

switch (answer) {

case 1 :

score ++;

System.out.println(" CORRECT ANSWER \n");

break;

default:

System.out.println(" WRONG ! THE CORRECT ANSWRE IS JAVA \n");

break;

// QUESTION NO 2

System.out.println(" QUESTION NO 2 : WHICH LANGUAGE IS PRIMARILY USED FOR WEEB


DEVELOPMENT AND IS KNOWN FOR ITS DYNAMIC NATURE ?");
System.out.println("1. RUBY \n2. PHP \n3. PERL \n4. PYTHON \n");

answer = inp . nextInt();

switch (answer) {

case 2 :

score ++;

System.out.println(" CORRECT ANSWER \n");

break;

default:

System.out.println(" WRONG ! THE CORRECT ANSWRE IS PHP \n");

break;

// QUESTION NO 3

System.out.println(" QUESTION NO 3 : WHICH LANGUAGE IS KNOWN FOR ITS OBJECT ORIENTED


FEATURES AND IS WIDELY USED FOR ANDRIOD APP DEVELOPMENT ?");

System.out.println("1. JAVA \n2. SWIFT \n3. KOTLIN \n4. C#");

answer = inp . nextInt();

switch (answer) {

case 3 :

score ++;

System.out.println(" CORRECT ANSWER \n");

break;

default:

System.out.println(" WRONG ! THE CORRECT ANSWRE IS JAVA \n");

break;

// QUESTION NO 4
System.out.println(" QUESTION NO 4 : WHICH LANGUAGE IS KNOWN FOR ITS COMPILED NATURE AND
ITS WIIDELY USED FOR OPERATING SYSTEM AND EMBEDDED SYSTEMS ? ?");

System.out.println("1. C \n2. C++ \n3. ASSEMBLY \n4. RUST");

answer = inp . nextInt();

switch (answer) {

case 4 :

score ++;

System.out.println(" CORRECT ANSWER \n");

break;

default:

System.out.println(" WRONG ! THE CORRECT ANSWRE IS JAVA \n");

break;

// QUESTION NO 5

System.out.println(" QUESTION NO 5 : WHICH LANGUAGE IS KNOWN SCRIPTING AND IS KNOWN


FOR ITS SIMPLICITY AND RELAIBILITY ?");

System.out.println("1. JAVA \n2. RUBY \n3. PHP \n4. LUA");

answer = inp . nextInt();

switch (answer) {

case 5 :

score ++;

System.out.println(" CORRECT ANSWER \n");

break;

default:

System.out.println(" WRONG ! THE CORRECT ANSWRE IS LUA ");

break;

} }

}
Program: 14

ZODICS SYMBOLS

package zodics.symbols;

import java.util.Scanner;

public class ZodicsSymbols {

private static String zodiasign;

public static void main(String[] args) {

Scanner inp = new Scanner (System.in);

System.out.println(" ENTER YOUR BIRTHDAY MONTH : ");

int month = inp . nextInt();

System.out.println(" ENTER YOUR BIRHTDAY DATE :");

int day = inp . nextInt();

String zodiacsign = "";

if (( month == 1 && day >= 20 ) || ( month == 2 && day <= 18 )) {

System.out.println("\nAQUARIES");

} else if (( month == 2 && day >= 19 ) || ( month == 3 && day <= 20 )) {

System.out.println("\nPISCES");

} else if (( month == 3 && day >= 21 ) || ( month == 4 && day <= 19 ) ) {

System.out.println("\nARIES");

} else if (( month == 4 && day >= 20 ) || ( month == 5 && day <= 20 )) {


System.out.println("\nTAURUS");

} else if (( month == 5 && day >= 21 ) || ( month == 6 && day <= 20 )) {

System.out.println("\nGEMINI");

} else if (( month == 6 && day >= 21 ) || ( month == 7 && day <= 22 )) {

System.out.println("\nCANCER");

} else if (( month == 7 && day >= 23) || ( month == 8 && day <= 22)){

System.out.println("\nLEO");

} else if ((month == 8 && day >= 23 ) || ( month == 9 && day <= 22 )) {

System.out.println("\nVIRGO");

} else if (( month == 9 && day >= 23 ) || ( month == 10 && day <= 22 )) {

System.out.println("\nLIBRA");

} else if (( month == 10 && day >= 23 ) || ( month == 11 && day <= 21 )) {

System.out.println("\nSCORPIO");

} else if (( month == 11 && day >= 22 ) || ( month == 12 && day <= 21 )) {

System.out.println("\nSAGITTARIUS");

} else if (( month == 12 && day >= 22 ) || ( month == 1 && day <= 19 )) {

System.out.println("\nCAPRICON");

} else {

System.out.println(" INVALID DATE ENTERED. "); }

System.out.println("YOUR ZODIAC SIGN :" +zodiacsign);

} }
Program: 15

NESTED SWITCH

public class NetedSwitchProgram {

public static void main(String[] args) {

int Category = 1 ;

int Item = 2 ;

// outer Switch Based on Ctegory

switch(Category) {

case 1:

System.out.println(" Category 1: Electronics ");

// inner Switch Based on Item

switch(Item){

case 1:

System.out.println("Item : Laptop");

break;

case 2:

System.out.println("Item : Smartphones ");

break;

default:

System.out.println("Unknwon Item in Electronics");

break;

case 2:

System.out.println(" Category 2 : Clothing");

break;
// inner switch Baased on Item

switch(Item){

case 1:

System.out.println("Item : Shirt");

break;

case 2:

System.out.println("Item: Jeans");

break;

default:

System.out.println("Unknown Category");

}
Program: 16

EVEN ODD CHECKER

package even.odd.checker;

import java.util.Scanner;

public class EvenOddChecker {

public static void main(String[] args) {

Scanner scanner = new Scanner (System.in);

// Taking Inputs From The User

System.out.println (" Enter A Number : ");

int number = scanner.nextInt();

// checking if the Number is Even or Odd

If ( number % 2 == 0 ) {

System.out.println ( number + " is an even number " );

} else {

System.out.println ( number +" is an odd number. " );

}
Program: 17

LARGEST OF THREE

package largest.of.three;

import java.util.Scanner;

public class LargestOfThree {

public static void main(String[] args) {

Scanner scanner = new Scanner (System.in);

// Taking input for three

System.out.println("Enter first Number");

int num1 = scanner.nextInt();

System.out.println("Enter Second Number");

int num2 = scanner.nextInt();

System.out.println("Enter Third Number");

int num3 = scanner.nextInt();

// Logic to find the Largest Number

int largest;

if( num1 >= num2 && num1 >= num3 ){

largest = num1;

} else if ( num2 >= num1 && num2 >= num3){

largest = num2;

} else {

largest = num3;

} }
Program: 18

You might also like