Preview

Assigment 2 Wad

Satisfactory Essays
Open Document
Open Document
302 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Assigment 2 Wad
Assignemt # 2

Subject: “ Web Application Development “

Name :
Reg#:
Section :

Submitted to: PROF.Shoaib Farooq

import java.util.*; class Student1 {
String name;
Student1 () {name=null; }
Student1 (String n) {name=n; } void setName(String n) {name=n;}
String getName() { return name;}
}
class Course {
String title;
Course () {title=null; }
Course (String n) {title=n; } void setTitle(String n) {title=n;}
String getTitle() { return title;} void dropCourse(){this.title=null;}
}

class Registration{
Student1 s;
Course c;
String reg; void setRegName(String n) {s.setName(n);}
String getRegName() { return s.getName();}

void setRegTitle(String n) {c.setTitle(n);}
String getRegTitle() { return c.getTitle();}

void register(String s,String c ) { this.setRegName(s); this.setRegTitle(c);
}

void regNumber(int s){ reg=reg+s;}

void dropCourse(){ c.dropCourse();} void print(){
System.out.print(s.getName() + " Register ");
System.out.println(c.getTitle());
}

public void mainMenu() { int opt; c=new Course(); s=new Student1();

}
}

class MainMenu {
Registration objr[]=new Registration[30];
Scanner scan=new Scanner(System.in);

int count=0; public void mainMenu() { int opt;

do{

System.out.print("Press 1 to Add Student\nPress 2 to Enter Course\nPress 3 to Registration\nPress 4 to Show Current Student Press\nPress 5 to Drop Student\nPress 6 to EXit "); opt=scan.nextInt(); objr[count]=new Registration(); if(opt==1){ System.out.println("Enter Student Name"); objr[count].setRegName(scan.next()); } else if(opt==2){
System.out.println("Enter Course Name"); objr[count].setRegTitle(scan.next()); } else if(opt==3){

objr[count].register(objr[count].getRegName(),objr[count].getRegTitle()); count++; } else if(opt==4){ objr[count].print(); } else if(opt==5){

You May Also Find These Documents Helpful

  • Satisfactory Essays

    Mis 302 Flowchart

    • 262 Words
    • 2 Pages

    Complete Java Program to accept the required input and accordingly produce the output as expected.…

    • 262 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    PRG/420 Week 3

    • 1025 Words
    • 5 Pages

    ; lastName = keyboard.nextLine(); // Insert a blank line System.out.println(); // Display user information System.out.println("Hello, " + firstName + " " + lastName + ".") ; System.out.println("Your annual salary is $50,000 and your commission " + "rate is 5%."); System.out.println("If this is not correct, please contact your HR " + "Representative.");…

    • 1025 Words
    • 5 Pages
    Good Essays
  • Satisfactory Essays

    Pt1420 Unit 7 Study Guide

    • 582 Words
    • 3 Pages

    1.Write a program to read a character from the keyboard and display at the beginning of the next line. Page: 69(Done)…

    • 582 Words
    • 3 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Nt1310 Unit 3 Assignment

    • 256 Words
    • 2 Pages

    Write a program to read the name of 5 students through keyboard and store them in a file “name.txt”.…

    • 256 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    Assesment1

    • 714 Words
    • 3 Pages

    Click and drag to select the assignment questions below. Then press CTRL + C to copy, or right-click the text and then click Copy.…

    • 714 Words
    • 3 Pages
    Good Essays
  • Satisfactory Essays

    Assesment 3

    • 436 Words
    • 1 Page

    1. Is gross profit or net profit more important to consider when you're deciding how successful and profitable a company is? Why? Explain. Net profit is more important than gross profit because gross profit is what you make before the government charges you taxes on that money.…

    • 436 Words
    • 1 Page
    Satisfactory Essays
  • Satisfactory Essays

    CMIS 102 Homework 3

    • 342 Words
    • 3 Pages

    Program Description - This program will allow a user to input their name and final grades from their courses and calculate their GPA accordingky. The amount of students as well as the amount of classes each student is taking, are undetermined.…

    • 342 Words
    • 3 Pages
    Satisfactory Essays
  • Good Essays

    Literature has become culturally diverse from different religions of different races. This has helped its quality and the stories; poems and plays have portrayed history, values, customs, and languages of particular groups. Literature is being multicultural now helps acquire knowledge of different societies in the world. The story Jewish Christmas by Faye Moskowitz, a poem My Papa Waltz by Theodore Roethke and the play Andre’s Mother by Terrence McNally provides for the diversity and the influence of family in literature.…

    • 468 Words
    • 2 Pages
    Good Essays
  • Satisfactory Essays

    Tafe Assmt 3

    • 828 Words
    • 4 Pages

    CHCCS400C – Work within a relevant legal and ethical framework: Assignment What you have to do Students need to complete all four (4) tasks: Task A Complete 12 short answer questions based on the learning material. Task B…

    • 828 Words
    • 4 Pages
    Satisfactory Essays
  • Good Essays

    Assingment 3

    • 565 Words
    • 2 Pages

    1. How would you characterize Timberland’s exercise of its corporate power in society? Is Timberland using its influence responsibly? If so, how?…

    • 565 Words
    • 2 Pages
    Good Essays
  • Satisfactory Essays

    WK 4 Assingmnt

    • 590 Words
    • 2 Pages

    For this assignment I chose to watch “The Big Bang Theory”. In the beginning of the episode, the two girls wanted to do an activity that the two boy characters hated. This was intended to get back at them for always making the girls do activities that the boys wanted to do.…

    • 590 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    assigment 3

    • 558 Words
    • 3 Pages

    For this assignment, using the situation given below, apply the S.W.O.T. Situational Planning Strategy which was described in Chapters 4 and 7 of your course text:…

    • 558 Words
    • 3 Pages
    Good Essays
  • Good Essays

    Assult

    • 472 Words
    • 2 Pages

    Intention to apply unlawful physical force or, Being reckless as to whether such force is applied…

    • 472 Words
    • 2 Pages
    Good Essays
  • Good Essays

    Assuat

    • 809 Words
    • 4 Pages

    In the past recent years, the US has experienced major tragedy from gun violence. The Century movie theater shooting which resulted in killing of 20 people and injuring 58 others. There was Clackamas Town Center shooting in Oregon which a gunman open fire with an AR-15 semiautomatic rifle killing two people and injuring two others. The most horrific shooting was the notorious Sandy Hook Elementary school shooting, which resulted in the in the death of 26 people from a man with a high powered rifle. These past shootings has now caused a debate over gun control in the US. President Obama has now recently called a on a ban on Assault weapons and other high capicty magazine. The definition of an assault weapon is considered to be a gun that can hold more then 10 bullets or a gun with a pistol grip. The right to bare arms is constantly being compromised. A ban on assault weapons is outrageous, and unconstitutional. The United States founders made this country because they wanted to get away from laws like this. Assault weapons should not be banned in the US for sever reasons.…

    • 809 Words
    • 4 Pages
    Good Essays
  • Satisfactory Essays

    assigment 4

    • 470 Words
    • 2 Pages

    U = 0.362 + 0.004*HD + 2.266*MEM + 0.436*CPU - 0.065*SCR - 1.368*W - 0.004*PRICE + 0.005*HDGROUP + 0.225*MEMGROUP + 4.008*CPUGROUP +0.684*SCRGROUP +0.569*WGROUP -0.007*PRICEGROUP…

    • 470 Words
    • 2 Pages
    Satisfactory Essays

Related Topics