Skip to content

Instantly share code, notes, and snippets.

View yaswanthrajyadiki's full-sized avatar

Y.Yaswanth Raj Kumar yaswanthrajyadiki

View GitHub Profile
@yaswanthrajyadiki
yaswanthrajyadiki / Item.java
Last active November 22, 2023 08:43
This is Shopping Cart Code
class Item {
private String productName;
private int quantity;
private double unitPrice;
Item(String productName, int quantity, double unitPrice) {
this.productName = productName;
this.quantity = quantity;
this.unitPrice = unitPrice;
}
public String toString() {
@yaswanthrajyadiki
yaswanthrajyadiki / Card.java
Created August 19, 2015 03:47
Library Catalog
/**
* Write a description of class Card here.
* @author (Yaswanth)
* @version (11-08-2015)
*/
public class Card {
/**
* titleOfBook in card catalog.
*/
private String titleOfBook;
@yaswanthrajyadiki
yaswanthrajyadiki / Quiz.java
Created August 19, 2015 04:15
This can create a quiz with questions and can add questions in add method which is class
import java.util.Scanner;
class Question {
private int serialNumber;
private String questionText;
private String choices;
private int correctAnswer;
private static int points;
Question(int serialNumber, String questionText, String choices, int correctAnswer, int points) {
this.serialNumber = serialNumber;
this.questionText = questionText;
@yaswanthrajyadiki
yaswanthrajyadiki / Account.java
Created August 19, 2015 09:09
Small Account problem using basic concepts in java
/**
* Write a description of class Bookshelf here.
*
* @author (your name)
* @version (a version accountNumber or a date)
*/
public class Account
{
private String name;
@yaswanthrajyadiki
yaswanthrajyadiki / Bookshelf.java
Created August 19, 2015 09:12
Book shelf problem using basics in java
/**
* Write a description of class Bookshelf here.
*
* @author (Yaswanth)
* @version (09-08-2015)
*/
public class Bookshelf
{
private String bookName;
@yaswanthrajyadiki
yaswanthrajyadiki / Stokens.java
Last active August 29, 2015 14:27
Using basics of java
/**
* Write a description of class StringTokenizer here.
*
* @author (Yaswanth)
* @version (08-08-2015)
*/
import java.util.*;
public class Stokens
{
@yaswanthrajyadiki
yaswanthrajyadiki / BookYourShow.java
Created August 19, 2015 09:20
BookYourShow application can be extended by anyone
import java.util.ArrayList;
import java.util.ListIterator;
class BookYourShow {
private ArrayList<Show> show;
private String userName;
private String userMobileNumber;
private String movieName;
private String movieShowDate;
private String movieShowTime;
private int numberOfSeats;
class Employee extends Person {
String designation;
int salary;
Employee(Person p,String designation, int salary) {
super(p.firstName, p.lastName, p.gender, p.age);
this.designation = designation;
this.salary = salary;
}
public String toString() {
String s = super.toString() + this.designation;
import java.util.List;
import java.util.ArrayList;
import java.util.ListIterator;
import java.util.Collections;
import java.util.TreeSet;
class SortGrade {
List<Student> stuList;
SortGrade(List<Student> stuList) {
this.stuList = stuList;
import java.util.List;
import java.util.ArrayList;
import java.io.BufferedReader;
import java.io.FileReader;
import java.util.StringTokenizer;
import java.util.Collections;
class DocumentOrdering {
List<String> fileNames;
List<String> fileContents;