Need some help with application

Need some help with application
0.0 0

#1

Application overview: Personal expenses management application that allows users to track how much money have they spent.
[MAJOR] Requirements:
As a result of test problem solution you should provide a command-line application that supports following commands:
● add 2017-04-25 12 USD Jogurt — adds expense entry to the list of user expenses.
Expenses for various dates could be added in any order.
Command accepts following parameters:
2017-04-25 — is the date when expense occurred
12 — is an amount of money spent
USD — the currency in which expense occurred
Jogurt — is the name of product purchased
● list — shows the list of all expenses sorted by date
● clear 2017-04-25 — removes all expenses for specified date, where:
2017-04-25 — is the date for which all expenses should be removed
● total PLN — this command should take a list of exchange rates from http://fixer.io , calculate the total amount of money spent and present it to user in specified currency, where:
PLN — is the currency in which total amount of expenses should be presented

[MINOR] Requirements: In order to get extra points for test problem solution you might cover your source code with unit tests.
Application usage example: Here is an example of normal application usage flow, for each command a corresponding output is shown:

add 2017-04-25 2 USD Jogurt
2017-04-25
Jogurt 2 USD
add 2017-04-25 3 EUR “French fries”
2017-04-25
Jogurt 2 USD
French Fries 3 EUR
add 2017-04-27 4.75 EUR Beer
2017-04-25
Jogurt 2 USD
French Fries 3 EUR
2017-04-27
Beer 4.75 EUR
add 2017-04-26 2.5 PLN Sweets
2017-04-25
Jogurt 2 USD
French Fries 3 EUR
2017-04-26
Sweets 2.5 PLN
2017-04-27
Beer 4.75 EUR
list
2017-04-25
Jogurt 2 USD
French Fries 3 EUR
2017-04-26
Sweets 2.5 PLN
2017-04-27
Beer 4.75 EUR
clear 2017-04-27
2017-04-25
Jogurt 2 USD
French Fries 3 EUR
2017-04-26
Sweets 2.5 PLN
total EUR
5.42 EUR

I’ve tried to do it like this, but i don’t know what to do next.

class List { constructor(date, amount, currency, product){ this._date = date; this._amount = amount; this._currency = currency; this._product = product; }

get data (){ 
return this._data;
 }

get amount(){
 return this._amount; 
}

get currency (){ 
return this._currency;
 }

get product (){
 return this._product 
} 
}

class Result extends List { 
constructor(date, amount, currency, product) {
 super(date);
 this._amount = amount; 
this._currency = currency; 
this._product = product;

} }

const out = new Result(2017-04-25, 12, 'USD', 'Jogurt'); 
console.log(Result);

#2

Firstly, welcome to the forums.

While we are primarily here to help people with their Free Code Camp progress, we are open to people on other paths, too. Some of what you are asking is pretty trivial in the Free Code Camp context, so you might find that if you’re not getting the instruction and material you need in your current studies, the FCC curriculum will really help you get started. At a modest guess I’d say investing a 4-5 hours working through the curriculum here will really pay off. You can find the curriculum at https://freecodecamp.org.

With your current questions, we don’t have enough context to know what you already know or don’t know, so it is impossible to guide you without just telling you the answer (which we won’t do).

Happy coding :slight_smile:


#3

I’ve edited your post for readability. When you enter a code block into the forum, precede it with a line of three backticks and follow it with a line of three backticks to make easier to read. See this post to find the backtick on your keyboard. The “preformatted text” tool in the editor (</>) will also add backticks around text.

Also, you need to tell us in detail what you need help with. We do not know if you do not understand what is being asked by the user stories or if you just do not understand how to code something in particular. Please give us more details.


#4

I am asking about giving me some guide how to do make this app. I mean like in general.


#5

This appears to be some kind of homework assignment. Have you gone through the Free Code Camp curriculum yet? I assume whatever you are using currently is not enough to help you solve this problem. If you were to work through our curriculum here, you would have a better chance of solving this problem.