?Python:x = 200 print(x % 2)
It’s a programming language
Are you saying that you didn't know that the language "python" existed?It’s a programming language
LolAre you saying that you didn't know that the language "python" existed?
I think he does know that it existed but you never know xD
package workspace;
import java.util.Scanner;
public class librarysystem{
static int num = 0;
static int invcount = 0;
static int ct = 0;
static librarysystem [] database = new librarysystem[20];
static librarysystem [] inventory = new librarysystem[20];
static Scanner sc = new Scanner(System.in);
int pgcount;
double price;
String author = "";
String title = "";
int bknum;
String ifs = "";
public librarysystem(int pagecount, double totalprice, String author2, String name, int count, String av) {
bknum = count;
pgcount = pagecount;
price = totalprice;
author = author2;
title = name;
ifs = av;
num++;
}
public static void display() {
for(int i = 0; i < 2; i++) {
System.out.println("Book Number: " + database[i].bknum);
System.out.println("Title: " + database[i].title);
System.out.println("Author: " + database[i].author);
System.out.println("Page count: " + database[i].pgcount);
System.out.println("Price: $" + database[i].price);
System.out.println("Accessibility: " + database[i].ifs);
System.out.println();
}
}
public static void printinventory() {
System.out.println("Here are the current books that you checked out.");
System.out.println();
for(int i = 0; i < invcount; i++) {
System.out.println("Book Number: " + inventory[i].bknum);
System.out.println("Title: " + inventory[i].title);
System.out.println("Author: " + inventory[i].author);
System.out.println("Page count: " + inventory[i].pgcount);
System.out.println("Price: $" + inventory[i].price);
System.out.println();
}
}
public static void checkout() {
System.out.println("Would you like to check out any books? y/n");
String input3 = sc.nextLine();
if(input3.equals("y")) {
System.out.println("Please enter the book number(only one first) to check out any books");
int input = sc.nextInt();
if(input < num) {
for(int i = 0; i < num; i++) {
if(database[i].ifs.equals("Yes")) {
if (database[i].bknum == input) {
inventory[ct] = database[i];
invcount++;
ct++;
database[i].ifs = "No";
}
}
printinventory();
if(database[i].ifs.equals("No")) {
System.out.println("Sorry, that book is checked out.");
}
}
}
if(input >= num) {
System.out.println("That is not a valid book number.");
checkout();
}
}
if(input3.equals("n")) {
System.out.println("Ok, come back later.");
}
}
public static void returnbk() {
}
public static void main(String[] args) {
System.out.println("Welcome to the library! Would you like to take a look at our books? y/n");
String input = sc.nextLine();
librarysystem thehobbit = new librarysystem(310, 9.99, "J.R.R Tolkien","The Hobbit",1,"No");
database[0] = thehobbit;
librarysystem thelittleprince = new librarysystem(96, 11.99, "Antoine de Saint-Exupéry","The Little Prince",2,"Yes");
database[1] = thelittleprince;
if(input.equals("y")) {
display();
checkout();
}
}
}
nice new signature i see u have improvedI think he does know that it existed but you never know xD
What's its end purpose?heres a big java project that im working onJava:package workspace; import java.util.Scanner; public class librarysystem{ static int num = 0; static int invcount = 0; static int ct = 0; static librarysystem [] database = new librarysystem[20]; static librarysystem [] inventory = new librarysystem[20]; static Scanner sc = new Scanner(System.in); int pgcount; double price; String author = ""; String title = ""; int bknum; String ifs = ""; public librarysystem(int pagecount, double totalprice, String author2, String name, int count, String av) { bknum = count; pgcount = pagecount; price = totalprice; author = author2; title = name; ifs = av; num++; } public static void display() { for(int i = 0; i < 2; i++) { System.out.println("Book Number: " + database[i].bknum); System.out.println("Title: " + database[i].title); System.out.println("Author: " + database[i].author); System.out.println("Page count: " + database[i].pgcount); System.out.println("Price: $" + database[i].price); System.out.println("Accessibility: " + database[i].ifs); System.out.println(); } } public static void printinventory() { System.out.println("Here are the current books that you checked out."); System.out.println(); for(int i = 0; i < invcount; i++) { System.out.println("Book Number: " + inventory[i].bknum); System.out.println("Title: " + inventory[i].title); System.out.println("Author: " + inventory[i].author); System.out.println("Page count: " + inventory[i].pgcount); System.out.println("Price: $" + inventory[i].price); System.out.println(); } } public static void checkout() { System.out.println("Would you like to check out any books? y/n"); String input3 = sc.nextLine(); if(input3.equals("y")) { System.out.println("Please enter the book number(only one first) to check out any books"); int input = sc.nextInt(); if(input < num) { for(int i = 0; i < num; i++) { if(database[i].ifs.equals("Yes")) { if (database[i].bknum == input) { inventory[ct] = database[i]; invcount++; ct++; database[i].ifs = "No"; } } printinventory(); if(database[i].ifs.equals("No")) { System.out.println("Sorry, that book is checked out."); } } } if(input >= num) { System.out.println("That is not a valid book number."); checkout(); } } if(input3.equals("n")) { System.out.println("Ok, come back later."); } } public static void returnbk() { } public static void main(String[] args) { System.out.println("Welcome to the library! Would you like to take a look at our books? y/n"); String input = sc.nextLine(); librarysystem thehobbit = new librarysystem(310, 9.99, "J.R.R Tolkien","The Hobbit",1,"No"); database[0] = thehobbit; librarysystem thelittleprince = new librarysystem(96, 11.99, "Antoine de Saint-Exupéry","The Little Prince",2,"Yes"); database[1] = thelittleprince; if(input.equals("y")) { display(); checkout(); } } }
its supposed to be a library systemWhat's its end purpose?
JartexNetwork is one of the largest Minecraft servers!
JartexNetwork was formed in 2015, and has developed its own plugins ever since!
We count with Factions, SkyBlock, Prison, Survival, Lifesteal, OneBlock KitPvP,
Gens, Bedwars, and TheBridge!
Come join us now at: play.jartexnetwork.com
If you enjoy playing, feel free to support us by purchasing some packages, ranging from crate keys, to permanent ranks.