Find Jobs
Hire Freelancers

Simple Database

$15-20 USD

Suoritettu
Julkaistu noin 20 vuotta sitten

$15-20 USD

Maksettu toimituksen yhteydessä
Part 1: Imaging the following situation: You have a set of recipes of various dishes that you cook for yourself. For each recipe you have a list of ingredients. You want to write a program that will randomly select 7 recipes ( for each day of the week) and will output a grocery list of ingredients that you need to buy in order to cook the selected dishes. Here's how you are going to implement this task. You are provided with a file [login to view URL] which I will provide. This file represents a kind of database for the recipe names and corresponding ingredients. On each line it contains a formatted representation of recipe ingredients: i.e., each line has the name of a recipe followed by a vertical line, followed by a list of ingredients ( with corresponding quantities in front). The quantity is separated from the corresponding name of the ingredient with a dash, and ingredients are separated by semicolons from each other. For example: Macaroni Cheese | 1 - macaroni; 0.25 - butter; 0.2 - flour; 1 - cheddar cheese; 0.5 - milk; 0 - salt; Avocado Salad | 2 - avocado; 1 - onion; 1 - rice; 0 - salt; There is one and only one recipe per line. Here, for simplicity, we do not have the units of measurement for the quantity of an ingredient, assuming that they are already prefixed for each ingredient (e.g. macaroni is measured in pounds, milk and cheese in cups etc.). Zero in front of an ingredient means - "to taste". (Comment: When reading the names of the recipes and ingredients discard all extra blanks so, for example, the name of the ingredient should be a string "cheddar cheese" whether it is written 1-cheddar cheese; or 1 - cheddar cheese ; in the file. Also, ignore cases.) The program should read [login to view URL], randomly choose 7 different recipes from [login to view URL] and output a list of groceries for a week (all ingredients from the chosen recipes should be added up). ******See other files for a text file containing the entire project description, the continued project description is also available in the deliverables section****** ## Deliverables 1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done. 2) Deliverables must be in ready-to-run condition, as follows (depending on the nature of the deliverables): 3) All deliverables will be considered "work made for hire" under U.S. Copyright law. Buyer will receive exclusive and complete copyrights to all work purchased. (No GPL, GNU, 3rd party components, etc. unless all copyright ramifications are explained AND AGREED TO by the buyer on the site per the coder's Seller Legal Agreement). ************************************************* (Continued from description) In particular: Create a class Recipe and a class IngredientNode. Each object of type Recipe should have a name (name of the recipe) and a list of ingredients. Specifically, this list of ingredients*should be implemented as a linked list*of IngedientNodes, where each IngredientNode should have fields String name, double quantity, and a link to a next node. Your driver program should be called [login to view URL] and should have (among others) the following methods: * public static Recipe getRecipe(int line)- should return an object Recipe from the specified line of file [login to view URL] (with a linked list of ingredients). Let the line numbering start from 1 (not 0). * public static void printIngredients(Recipe r)- print out all the ingredients (names and quantities) of the given Recipe object . * public static Recipe findRecipe(String recipeName)- find the recipe with a given name in the [login to view URL] file and return a corresponding Recipe object. Should throw a RecipeNotFoundException if the recipe with that name is not in the file. * public static void printAllRecipeNames() - should read and print out the names of all recipes from the [login to view URL] * public static void chooseRandomRecipes(int n) - randomly choose n recipes from the [login to view URL] file and print out their names; * public static void printGroceryList() - randomly choose 7 recipes from the [login to view URL] file and print out the resulting list of ingredients and their quantities (the quantities should be added up for identical ingredients). (Note: You have to use linked list representations of the recipes here! Your resulting grocery list should itself be a linked list of ingredients.) Part 2: Create a GUI (graphical user interface) for this program. Call your file Project6GUI.java. It should have: - Two buttons labeled "Get Recipes" and "Show Grocery List"; - Two text areas labeled "Recipes for a week" (editable) and "Groceries for a week" (not editable). It should have exactlythe following functionality: - When the button "Get Recipes" is pushed the program should read from the [login to view URL] file, randomly select 7 recipes, and display them in the "Recipes for the week" area, one recipe per line. - When the button "Show Grocery List" is pushed the program should read the recipe names from the "Recipes for the week" area , go to the [login to view URL] file, find these recipes and display a resulting grocery list in the "Groceries for a week" area. Note that when the button "Show Grocery List" is pushed you do not randomly choose recipes again but read them from the "Recipes for the week" text area instead. (Since "Recipes for the week" is an editable text area you should be able to type the (valid) names of the recipes yourself and pushing the "Show Grocery List" button should produce the corresponding grocery list nevertheless) ## Platform Windows XP
Projektin tunnus (ID): 3158742

Tietoa projektista

7 ehdotukset
Etäprojekti
Aktiivinen 20 vuotta sitten

Haluatko ansaita rahaa?

Freelancerin tarjouskilpailun edut

Aseta budjettisi ja aikataulu
Saa maksu työstäsi
Kuvaile ehdotustasi
Rekisteröinti ja töihin tarjoaminen on ilmaista
Myönnetty käyttäjälle:
Käyttäjän avatar
See private message.
$10 USD 2 päivässä
5,0 (2 arvostelua)
2,9
2,9
7 freelancerit tarjoavat keskimäärin $14 USD tätä projektia
Käyttäjän avatar
See private message.
$16,15 USD 2 päivässä
5,0 (126 arvostelua)
4,7
4,7
Käyttäjän avatar
See private message.
$17 USD 2 päivässä
5,0 (25 arvostelua)
4,4
4,4
Käyttäjän avatar
See private message.
$17 USD 2 päivässä
4,6 (3 arvostelua)
2,6
2,6
Käyttäjän avatar
See private message.
$6,80 USD 2 päivässä
4,7 (3 arvostelua)
2,1
2,1
Käyttäjän avatar
See private message.
$17 USD 2 päivässä
5,0 (5 arvostelua)
1,9
1,9
Käyttäjän avatar
See private message.
$12,75 USD 2 päivässä
0,0 (0 arvostelua)
0,0
0,0

Tietoja asiakkaasta

Maan UNITED STATES lippu
United States
5,0
1
Liittynyt maalisk. 25, 2004

Asiakkaan vahvistus

Kiitos! Olemme lähettäneet sinulle sähköpostitse linkin, jolla voit lunastaa ilmaisen krediittisi.
Jotain meni pieleen lähetettäessä sähköpostiasi. Yritä uudelleen.
Rekisteröitynyttä käyttäjää Ilmoitettua työtä yhteensä
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Ladataan esikatselua
Lupa myönnetty Geolocation.
Kirjautumisistuntosi on vanhentunut ja sinut on kirjattu ulos. Kirjaudu uudelleen sisään.