Program With Ability To Book Appointments For A Number Of Different Services
Sep 30, 2014
I am creating an apointment application. This programm will have the ability to book apointments for a number of different services, such as doctors, hairdressers, teachers etc for a number of cities.
These information will be placed on a combo box and ideally i would like to provide only the options available acording to the choices made so far.
So, for example we have
A Pediatric in London
A Vet in London
A Sergeon in Berlin
A Barber in Berlin
A Heardresser in Rome
A Programmer teacher in London
An English teacher in Rome
My thinking is that the user choses the city, for example London, then there will be a type of service combo box. In this case (of London) it will hold Doctors and Teachers. If Doctors is chosen, the next field will hold the available Medical specialty, i.e. Pediatrics and Vets and according to that choice the apropriate doctor will pop up.
My problem is not how to programm that. i havent got there yet.
My problem is how to design it! I am thinking that each individual will be an object. each having the same fields, city, type of service etc. But in such a way i am not sure how i can manage to get all the appropriate information in order to poppulate the combo boxes.
I would have to search all the objects for each combo box? From a rough testing i did, i think i could easily get all the individuals that resign in London, but that would give me two records for the doctors(for example).
I have a Database with Data of people (name, adress, phone number).
If a user enters a phone number (CLIENT) -> the correct person with the name and adress should appear.
I build up the infrastructure and now I'm at the point that I have to create a Webmethod for it. I just worked on projects like addition of two integers, hello "name", ... I think this example now is harder, BUT i can learn a lot!
I'm trying to build a method that can search a binary search tree for a specific target and then return the number of probes it took to get there. It seems to me that the best way to do this would be a recursive search method and a counter that tracks the number of calls. But I'm struggling with how to implement this. Here's the code I have so far. what works/doesn't work with the method.
// Method to search the tree for a specific name and // return the number of probes public T search(BTNode<T> btNode) {
I'm trying to search a library program by book index and running into some trouble with my HashMap. Here's the code in question:
Java Code:
public String searchByBookIndex(int input) { NumberFormat fmt = NumberFormat.getCurrencyInstance(); Map<Integer, Book> bookMap = new HashMap<>(); for (int i = 0; i < author.booksByAuthor.size(); i++) { bookMap.put(author.booksByAuthor.get(i).getBookIndex(), book);
[Code] ....
The search itself works fine; however, the problem is that the values of everything in the HashMap are overwritten by the last book entry. For example, let's say there are four books (index in parenthesis):
The Book (1), A Wonderful Book (2), A Great Book (3), A Bad Book (4).
Once the code above iterates, the HashMap out is this (via println):
1 = A Bad Book, 2 = A Bad Book, 3 = A Bad Book, 4 = A Bad Book.
I have application written in rest with Jersey-Jackson for JSON processing. All the resources produce and consume JSON. Now, the problem is, it is a server intensive application and large number of request will be hitting the server with large JSON request object. Now, because of this reason, when the JSON object gets converted in to Java object with String fields in it mapping to JSON request values large number of string objects are getting created which is resulting in frequent GC.
I have a beginning Java Program I have been working on that creates a number guessing program where the computer guesses a number that the user is thinking of within a certain range. I so far have the program below, but need getting rid of a few kinks/ adding features.
-First, I need to set it up so that the user will be prompted and give a range. It should run and produce something like this:
Welcome to this first-ever mind-guessing program!
Please pick a range (higher than 1 and no larger than 50): 32
You will choose a number between 1 and 32... and I will try to guess it.
With each of my guess, you will tell me whether I am too high (h or H), too low (l or L), match (m or M), or you want to quit (q or Q). My objective is to find the number using as few guesses as possible.
-Second, the game is supposed to give up and restart after failing the five, guesses, but for some reason, after it fails the fifth time, it prompts a fifth guess once again instead, then restarts after- I need to prevent this, so that it should look something like this:
My fourth guess is 17: h My guess is too high?
My fifth guess is 16: h *** I am unlucky this round. I give up.
Let's play!
My first guess is 10: etc..
import java.util.*; import java.lang.Math; public class numguessprac1 { // Declaring variables public static String input; public static int quit; public static int guess; public static int wins;
trying to write a program that takes a user inputted number and converts it to a binary number.
Here's what I have:
package com.java2novice.algos; import java.util.Scanner; public class Converter { static Scanner console = new Scanner(System.in); public void printBinaryFormat(int number){ int binary = console.nextInt();
I am trying to build an address book, and I started from what i know how to do.
public class Persona { String nome; String indirizzo; int cellulare; public Persona(String nom, String ind, int cel) { nome = nom; indirizzo = ind; cellulare = cel;
[code].....
Now I would like the program to take a string I insert on command line (for example java Cerca"Robert Baratheon") and compare it to the nome field of every Persona in the address book.
I found out what my next java class project is, and i am trying to get a head start on it. It is a simple address book. it needs to have 4 choices that get cycled through until quit is chosen:
1. add business contact 2. add personal contact 3. display contacts 4. quit
I have made an abstract contact class with a personal subclass and business subclass(all 3 are required). they have all been made, with set/get methods(the wonders of encapsulation and polymorphism have finally hit home!). The main program needs to add a new subclass object when chosen, and it needs to accept and store contacts by type
So, i am figuring 2 object arraylists for business/personal.
My question is: how do you create an object without having a name for it already programmed? Does it even need to have a unique name, since it would be stored in a seperate index and/or arraylist?
I have a question about arraylist objects.... I want to create an address book that will contain a persons information (name, phone, address, email..etc..). The first two snippets of code are from the same class ContactArrayList and the last one is from the class Contact. Do I need to create a separate arraylist for each data type? Is it possible to use a single arraylist to contain all the object (person) information and then be searched for using a GUI? I would also like to be able to access this data to be manipulated using a JFrame (add, edit, and search).
public class ContactArrayList<E> implements List<E> { public int size, capacity; E contact; private E[] contacts; public ContactArrayList() { size = 0; capacity = 20;
I have a program for a phone directory. It needs to add, delete, append, and edit telephone records. I've gotten it to write and search the files. Just need to get it to delete and edit them.
Why my borrowBook, returnBook, getBookIndex, remove book and printAuthorBook methods wont work. They all have a parameter that is a string and Im guessing its a common problem in all the methods. I think all my code for Book class is right. Iv attached the two classes. I also attached the test library which tests the two classes.
public class Book { // The fields: private String author; private String title; public int pages; public String refNumber; public int numBorrowings; boolean available; // add more fields here
So for the last few weeks I have been working on a Java project for school. I see the light at the end of the tunnel, but I have run into some speed bumps with my main class. It was working fine, but I was pulling an all night and I deleted some of my code by mistake.Now I am not seeing what is exactly wrong. Anyways, the project was to create an address book complete with a menu system.
Here are all of my classes:
import java.util.ArrayList; /** * A model of an address book which keeps track of contacts. * An address book object should keep track of the concept of a current contact (think index). * You must use an ArrayList for your implementation. */ public class AddressBook { Contact contact = new Contact();
I'm working on a problem where I have to use the FileInputStream to opens a file that contains the name of a user's favorite book and then displays it.
If the file doesn't exist, then I prompt for the book title and write it to the file using FileOutputStream. This is what I have so far but I'm lost because if I put a file that exists in line 8 then it closes, but if I don't and the user puts their favorite book nothing happens. Or, as far as I can tell nothing does.
import java.io.*; class DisplayBook { public static void main(String[] args)
I have to fetch only the book name attribute and use it for display .However say for example ,I have got the list of Books ie(C#,Oracle,Archius) ,passing this value to a method should return me an array of URL nodes value within it.
The idea is to display the book names in a list and then on user selection , corresponding URL needs to be fetched.
Was able to get the loop for traversing the nodes
[java=code] NodeList nodeList = document.getDocumentElement().getElementsByTagName ("Book"); for (int i = 0; i < nodeList.getLength(); i++) {... [java=code]
So
a) Display the BookNames
b) Get the corresponding URL's for the particular book if I pass the Bookname
import java.util.Scanner; public class pdonahue_Perfect { public static void main (String args[]) { int test; int value=0; Scanner input = new Scanner(System.in);
[code]....
i have just a couple of issues when running my program. -First, When i enter 0 it should print..
Please enter a possible perfect number: 0 0:NOT PERFECT
-Second, when i get a perfect number. it should show the answer in descending order..
Please enter a possible perfect number: 6 6:3 2 1
mine shows: Please enter a possible perfect number: 6 6: 1 2 3
**everything else compiles correctly with no errors
how many integers the user wants to use. The user will enter for example a 4. The user inputs a 2, 4, 6, and 10. So then we get our outputs...Then the code will ask if you want to run this program again. My question is, if the user inputs a -1 for example 2, 4, 6, -1....the code will not continue. I wanted to use a while loop, such as while (scores != -1) but it doesn't work.
Enter the amount of integers you want to use4 Intenger # 1 2 Intenger # 2 4 Intenger # 3 6 Intenger # 4 10 You entered 2.0 4.0 6.0 10.0 Average = 5.5 Variance = 8.75 Standard Deviation = 2.96 Do you have another set of numbers?
A GUI program that allows user to enter their name and the program will convert it in number using array.
For example if i input "EUNISE" the output should be 521149195
Because the letter equivalent of
a = 1 b = 2 c = 3 d = 4 e = 5 f = 6 g = 7 h = 8 i = 9 j = 10 k = 11 l = 12 m = 13 n= 14 o = 15 p = 16 q = 17 r= 18 s = 19 t = 20 u = 21 v = 22 w = 23 x = 24 y = 25 z = 26
I just started learning Java, I was asked to write a simple program that prints a message if it encounters the number 7 or its multiple.
This should be achievable using simple loops and simple operations...
Here is my attempt:
Java Code:
Scanner scan = new Scanner(System.in); int i, j, temp; i = scan.nextInt(); // Awaiting user input j = scan.nextInt(); // Awaiting user input if (i > j){ // i = 10 j = 0 temp = i; // temp = 10
[Code]...
Now it works fine for numbers that are less than 70...
I am not sure what to do in case if for example 'i' and 'j' are very big numbers
I mean, I need it to detect the 7s even if it in the thousands place, actually - no matter how big is the number... So far I only made it to work for numbers that are less than 70...
I am writing a program that checks if a number is prime or not. Code below.
for(int i = 2; i < P; i++){ if (P % i == 0) { System.out.println(P + " Can also be divided: " + i); return; } } System.out.println("Prime number.");
It works but, if a number is not a prime. I need to print out all the numbers that it can be divided with. For example if a number would be 8: it can also be divided with 1, 2, 4, 8.
Its a program that calculates Fibonacci number.This program uses recursion.
import java.util.Scanner; public class FibonacciMemoization{ static int[] fib = new int[60]; public static void main(String[] args){ Scanner input = new Scanner(System.in); System.out.print("Enter a Number :"); int number = input.nextInt();
So im trying to make a coin flip game in java. Im relatively new to the language and the only other language i knew was javascript so im still learning. Ive already made one before using just one class and putting all the code inside, but im now trying to do it with methods since im trying to learn them. The basic idea of the game is that the user picks how many coins they'd like to flip, they pick heads or tails, then the computer flips the coins and calculates if there was more heads or tails to tell the user if they won or not. Im not quite complete with the program as you can see but ive already run itno an error. I was just doing some tests on the code i already have and i found that when i call the method settingUpCoin in my main class the program terminates. So basically, when i run it, it executes userImp right, transform right, but then it dosent let you enter a value for howManyCoins and terminates before you get to settingUpCoin.
(Notes: this was all done in eclipse luna build or the java ide. The class files are all separate in the actual thing i just put them together here to demonstrate my code.
import java.io.IOException; public class Coin { double myCoin; int numOfCoins; int counter; double arrayOfCoins[] = { };
I was given the assignment of creating a number to word program for my first college java programming homework.
Here is what I have created so far :
import java.util.*; public class PrintNumberInWord { // saved as "PrintNumberInWord.java" public static void main(String[] args) { int number = 5; Scanner sc = new Scanner (System.in); { System.out.println ("Enter a number"); System.out.println(" "); if (number == 1) {
[Code] .....
The first lines were made for us so we could follow a guideline, however, no matter what I type the command prompt displays 5 to me, I know thats because 5 is defined in the beginning but backspacing 5 causes the program not to work at all, how can I get this program to work properly?