Write a program that asks the user to enter the amount that he or she has budgeted for a month. A loop should then prompt the user to enter each of his or her expenses (title and amount) for the month, and keep a running total. When the loop finishes, the program should display the amount and inform the user that he or she is over or under budget. The program should also display Total expenses with their title.
Sample Output:
What is your budget for the previous month?
30000
Enter your expenses with their purpose/title
Food items 5000
Any other expense? Y
Clothes 5000
Any other expense? N
Good Job! You saved 20000 from your previous month. Here are your details
Total Budget: 30000
Food items: 5000
Clothes: 5000
Remaining Budget: 20000
Thank You!
Related
Context
A seller is from one and only one country (M). An end user wants to purchase membership which costs 500 EUR.
It appears that the seller's country (M) is taken as a reference when calculating taxes not only for country M but also for all other countries. In this example, I defined two countries and their different tax rates.
Tax for country M is 9%, and when I select it, then the system spits out "500 EUR (incl. 41,28 € tax)"
41,28 € is 9% of 500.
However, if during the checkout I select "country C" then the system spits out "555,05 € (incl 96,33 € tax".
The way THIS is calculated is by taking a non-tax amount from country M 458,72 EUR (500 - 41,28) and adding to it tax amount defined for country C (21 %).
458,72 EUR x 1,21 = 555 EUR.
(This does not make sense. The user changed the country during checkout process, but the system ignores it).
This way, what is defined as the package price, changes constantly (as example above instead of 500 EUR it shows 555 EUR as the total price)
The way it SHOULD be calculated based on my opinion is: when a user during the checkout selects country C the full amount defined for the entire package (500 EUR) and defined tax rate for the selected country (country C = 21 %) should be taken to calculate the tax amount.
I would expect the result: "500 € incl 86,77 € tax."
(86,77 is 21% of 413,22 EUR)
Question:
Why is WooCommerce not refreshing country during the checkout when a user selects a country different from store country?
How can I setup this functionality with WooCommerce?
Target functionality is to define membership packages for everyone independent of countries. And all users should see (and pay) the same price.
But when a user from country M goes through the checkout process then in reference to the total price the tax should be calculated. Same should work for any other country.
Am stuck in a situation that I cant seem to solve, still learning so would appreciate if you could tell me what am I doing wrong and how do I get this right? It seems simple, but not for me anymore.
Background:
ACME company sells products in various cities and I need to check if ACME is Cheaper, Same or Expensive in terms of pricing. The same product may be sold in 10 different stores in a city and we want to know:
How is ACME doing for each product by City or by Store and I
calculate that as follows:
For each City:
List all the instances of that one product (lets say that product was sold in 10 stores in Dallas,so 10 instances,which means we may have 10 different store prices
Then return the minimum price of these 10 prices
Compare this minimum price against the ACME price and determine whether the product is Cheap, Same or Expensive
Formula:
Measure to calculate min price = 1 Min Price = CALCULATE(MINX(Data,Data[Store Price]),ALLEXCEPT(Data,Data[Barcode],Data[City],Data[Match Type],Data[Store]))
Calculated Column to detrmine status = 2 Price Status = if(Data[ACME Price]<[1 Min Price],"Cheap",if(Data[ACME Price]=[1 Min Price],"Equal","Expensive"))
Problem to be solved:
Screenshot 1 - When i have stores listed along with City, then the formula should consider the Store column and give me minimum price per Store (basically it will do a row by row comparison as a a store will show only once per city) which is what its doing in the "Min Price" and also the status is correct
Screenshot 1 - With Stores
[
Screenshot 2 - When I remove stores, the "Min Price" column is showing the right minimum price for a product per city, however the Status is incorrect - for product ending 7572, both the status must be Equal and for product ending 3566, it should be Expensive
Screenshot 2 - Without Stores
Can someone please advise what am I doing wrong? How do i get the status right when viewing by City?
I have created multiple journals for an item (suppose "item1") in AX2012 with multiple rates and different from and to date.
Like for Journal 1, From date is set as 1/12/2013 and to date is NULL and rate as 50.
for journal 2, From date is set as 7/12/2013 and to date is NULL and rate as 60.
Now, logically when selecting item in sales line form on or after 07/12/2013, I must get unit price 60. But unit price that i am getting is 50.
How to get latest price of an item, account, to, from date in sales line form?
It is valid in AX to have more than one active price record (PriceDiscTable).
In your case both 50 and 60 are valid rates, it then does the service of choosing the lesser one!
In journal 2 you should find the old rate, then apply an end date of 06/12/2013.
As this is cumbersome, it is a usual customization to auto-close prices. This could be done in the insert method of PriceDiscTable.
I am making attendance management system in which I have to record the time in and time out of an employee several times a day.
This can easily be achieved if I add a new row for every timein and time out.
But the problem is that the number of employees is very high, so
I want to add timein and timeout horizontally rather than vertically.
How that can be done?
e.g
id | Barcode | date | time in | time out | time in | time out| .......
| total time
I agree with the Comments that you should keep the data in a vertical fashion because it is a better design and utilizes the "relational" aspect of the database. Based on your description of the system having approximately 90,000 employees and may 5-10 rows per employee in the table (90k * 10 ).... you should consider having an Index on the employee id field (FK) so that your queries are more efficient. By using an Index, you shoudl be able to store many records and not see any speed issues.
I am trying to design a simple SQLite database to bill players on a server. The server is paid for on a monthly basis at a cost of $10 (but this might change).
I would like to have the following tables (or something better):
Months:
-id (int primary key)
-ref (text) something like "JAN11 just for readability"
-cost (real) something like 10 or 9.5 the monthly cost of the server
Players:
-id (int primary key)
-name (text)
The cost should be divided among the players who logged on at the end of the month (ie. 5 people log in in January they get the $10 split among them).
In short:
I don't know how to store whether or not the players logged in during the month so as to divide the cost among them.
Another good table to have would be Logins, e.g.:
Logins:
id int,
player_id int,
month_id int
That way you could just check if a player logged in, or even also check how many times they logged in (assuming you wanted to track that).