Archive

Posts Tagged ‘conditions’

Redirections With Conditions

February 4th, 2012 Comments off

The description have been exposed before. So no matter

Custom Mt4 Indicator Based On My Condition

January 25th, 2012 Comments off

Hi,

I need an indicator made that can be applied to MetaTrader 4 charts in daily time frame as an indicator not an EA. I would like buy/sell arrows with audible sound with the option if I want it to sound at the close of a candle or right at the moment when the conditions are met before the close of the candle.

For Buy Condition: There are 3 conditions need to set and will share once you got selected on the job.

For Sell Condition: There are 3 conditions as well

All the conditions…

Writers Comfortable In Writing Health Conditions

November 22nd, 2011 Comments off

I’m now here to get genuine writers who can comfortably write articles on health conditions (say diabetes…etc).

The article will cover general info about the disease and words are no limit though we can set 1000 words as standard. Any person from medical/paramedical will understand this.

Initially 10 articles is my target. I put it on website and then check what’s the response. If all go well, I’ll hire you again and again here.

BID for 10 health conditions (1000 words each). Mind t…

Fix Php Script – Import Magento 1.3 Coupons

October 10th, 2011 Comments off

We are trying to import a large amount of coupon codes to Magento using the PHP script coupons.php attached. It worked successfully, however we are only able to import Conditions and not Actions > Apply the rule only to cart items matching the following conditions (leave blank for all items).

The conditions portion we edited looks like this:

$conditions['1--2'] = array
(
‘type’ => ‘salesrule/rule_condition_product_found’,//-> means ‘if all of the following are true’ – same rules as above for ‘aggregator’ and ‘value’
//other values for type: ‘salesrule/rule_condition_product_subselect’ ‘salesrule/rule_condition_combine’
‘value’ => 1,
‘aggregator’ => ‘all’,
‘new_child’ => ”,
);

$conditions['1--2--1'] = array
(
‘type’ => ‘salesrule/rule_condition_product’,
‘attribute’ => ‘sku’,
‘operator’ => ‘==’,
‘value’ => ‘kgbdeal001′,
);

…but what we really need is to say:

Actions > Apply the rule only to cart items matching the following conditions (leave blank for all items)

If ALL of these conditions are TRUE :
SKU is kgbdeal001

Professional Articles On Heating And Air Conditions

September 19th, 2011 Comments off

I’m Looking for a top professional writer to write 5 professional articles on heating repairs and air conditions. 350 to 400 words for $2.5 each.

Requirements:

1,I must see your sample work.

2,Articles must Pass copyscape

3,Article must be grammer and spelling error free.

Preparation And Writing Of Our Terms And Conditions

September 7th, 2011 Comments off

We are a new daily deals website based in the UK and are looking for a writer to come aboard our team that can prepare our terms and conditions to comply with our sector. This will be for our merchant partners.

If you need more information please contact me.

Terms And Conditions – Sales Contracts

June 13th, 2011 Comments off

Looking to purchase or have created computer business contracts

Documentation Term And Conditions

May 30th, 2011 Comments off

Need someone to write the following for my website:
1. Term and condition
2. FAQ
3. How it works
4. Some email templates

Please DO NOT copy content from internet.

I Need A Query Run On Join Based On Conditions

May 8th, 2011 Comments off

*** Experienced PHP Coders only
*** I need this within 2 days after final specs are given

This script displays ads on affiliate sites. I need when a user joins based on conditions certain rows are inserted using an insert query. Users can select which ads they want to run in this ad rotating script, this is accomplished in the banner table where they select an ad to run in the users ad rotation this creates a row for that ad and size.

When a user joins I need something similar to this basic insert query to run

Insert into $$$$$ (user_id, bid, used, siteimps, siteclicks, revenue)
Values (‘{$$$$$}’,'{$$$$$}’,'$$$$’,$$$, $$$,$$$)

which will insert ads instantly in the users rotation on signup

Categories: PHP, Query Tags: , , , , , ,

Shiftcode Api Upgrade Script

May 1st, 2011 Comments off

I’m not sure all that I would need to specify as I’ve never commissioned the writing of a custom script before but I will make an attempt here and let me know if anything needs clarification.

I would like for this script to allow me to set conditions for all users with the following customizable parameters:
- Actionable settings:
1) Upgrade to level 1 in which if the below conditions have been met, the member will gain X% increase in payout per offer
2) Upgrade to level 2 in which if the below conditions have been met, the member will gain X% increase in payout per offer
3) Upgrade to level 3 in which if the below conditions have been met, the member will gain X% increase in payout per offer
4) This could potentially repeat up to ten levels

- Number of offers to be completed before actionable setting takes effect. This parameter can be set to between 1-1,000. Each subsequent upgrade in level will have its own number of offers to be completed before taking effect.

- Time frame setting: this parameter will set the amount of time before resetting the amount of completed offers back to zero. Allow for daily, weekly, monthly, quarterly, annually, and lifetime.

Also, how would it be installed? Would you give me the script and I would manually install it? Or would you do it for me?

That’s all I can think of for now. If another step needs to be added, or something needs clarification please let me know.

Oh, if I we agree on the quoted price, please note in your bid if you would require exclusive licensing rights, or if sharing or allowing me to have exclusive licensing rights to this script would be acceptable? Let me know your initial thoughts.

Create An Insert Query Based On Conditions

April 26th, 2011 Comments off

*** Experienced PHP Coders only

This script displays ads on affiliate sites. I need when a user joins based on conditions certain rows are inserted using an insert query. Users can select which ads they want to run in this ad rotating script, this is accomplished in the banner table where they select an ad to run in the users ad rotation this creates a row for that ad and size.

When a user joins I need something similar to this basic insert query to run

Insert into $$$$$ (user_id, bid, used, siteimps, siteclicks, revenue)
Values (‘{$$$$$}’,'{$$$$$}’,'$$$$’,$$$, $$$,$$$)

which will insert ads instantly in the users rotation on signup

Categories: PHP, Query Tags: , , , , , ,

Write Static Html Pages For Terms Conditions. About Us Etc

April 26th, 2011 Comments off

I need 5 pages written for my website gigpalace.com

Terms & Conditions
About Us
Privacy Policy
Contact Us
and Advertising.

I can give you info for this, but it must be a smart and clever rewrite. Bonus for images added on pages that are associated with site theme.

This should be a quick and inexpensive project.

Write Terms Conditions & Help

January 29th, 2010 Comments off

I need the following items to be writeln for my website in English (US)
1. terms and conditions of use (4-5 pages ~ 5,000 words)
2. privacy policy (~ 500 words)
3. frequently asked questions (1 page ~ 1,000 words)
4. some simple help (1 page ~ 1,000 words)

I will provide you with 2 examples of each existing documents (my website is very similar to the one in examples).
Cannot just copy and paste, product must differ from provided samples.
Nice html/word formatting a plus for a website, but not required.

I may choose 2 winners for this project.

Property Partner Extranet

January 14th, 2010 Comments off

*** READ CONDITIONS BELOW BEFORE BIDDING ***
A Full spec will be given to 3 x shortlisted bidders.

Project Requirement
My client require a partner extranet to manage their property partners. The company sells properties (from vendors [resort developers])

High Level User requirements
1. Content Management System (CMS) section (front page, t&c, )
2. Search – Map facility
3. Partner management
4. Lead Management
5. Vendor Management
6. Stock Management
7. Sales in Progress
8. Commission section
9. Report Wizard
10. Campaign Management
11. Upload to portals
12. Tags (multi level tagging)
13. Groupings of list (ie group certain leads/partners/vendors for later reloading etc)

Linking with PORTAL
1. The company have a portal (work in progress by another team)
2. The idea is that the property information in th extranet must automatially display in the portal as well.
3. This is a lower priorty and phase 2 but needs to be considered.

Conditions;
1. COMPANIES (NOT individual bidders) well experienced in developing extranets, crm and/or property portals – you MUST have a portfolio to showcase with DEMO details – CRITICAL!!!!!!
2. No payment upfront will be allowed, monthly payments will be made on progress
3. dedicated programmers that can manage a tight deadline
4. Proper testers – unit, stress, regression etc
5. Professional web designers – specially UI

************DO NOT BID IF YOU DONT MEET THE CONDITIONS – BIDS WILL BE REJECTED FOR THOSE NOT MEETING THE CONDITIONS ***************

Form Filling Bot

October 25th, 2009 Comments off

Hi,

I need a program that automatically fills preset data into a form (just one text box) and then submits it and possibly reads the output. It is to check trends on a sports data site. It is quite hard to explain but basically i would like to be able to set conditions (or if possible the program create its own conditions) then the program automatically inputs them into the form, the output is read and if it is a good trend (certain team wins 15 games and loses 0 under those conditions) it can be saved and viewed later.

I dont know how much of this is possible.

The site it needs to work with is, www.killersports.com and more speciifically with the form on the page – http://killersports.com/nba.py/query?&sid=guest

If you have a look near the bottom of the page you might be able to work out how it works from the variables that it deals with.

I realise that I probably havent explained this very well so i will do my best to answer any questions on the message board.

Thanks

Evan

Need Ajax Fix

October 2nd, 2009 Comments off

I have 3 pages which require to be ajaxed and conditions checked. The conditions are already present are being checked in the next page using php. There are several conditions which need to be checked. an example of what we are looking for would be

http://www.pariscityrama.com/visit-paris-by-day/visit-paris-half-day-tours/visit-montmartre-and-the-louvre/28A111.html

click on book now and the following screens are exactly what we want as far as flow process and design. We have all the php code but need someone to make it check on the same page.

NEED IT COMPLETED BY SUNDAY.

Ea For Mt4 Platform

August 10th, 2009 Comments off

I need an MT4 EA built from scratch using MQL4. The EA needs to be built in such a way that I can optimize across a number of different variables. The EA requires a number of conditions across consecutive time periods to be met before opening a trade. The EA then monitors the trade checking that certain conditions continue to be met. If these conditions cease at the end of a period, the trade is closed. A stop loss is set at the end of each period based on recent volatility. A detailed specification will be provided. It is expected that there will be a number of iterations in the project development and I am looking for a developer that is highly communicative, responsive and able to proactively contribute suggestions. Excellent English is essential.

Terms And Conditions

July 5th, 2009 Comments off

I need terms and conditions written for my website.

More details in PMB

Html Form – Javascript Help

June 9th, 2009 Comments off

I built this FORM to collect information from a prospective client and store it into a database and also email it to my email account.

I have two problems I need help correcting, they are both listed in detail below.

This should be a quick fix, I’m just having trouble figuring it out.

Site: http://www.livehealthinsurance.com

pages with problems:
-http://www.livehealthinsurance.com/quote2.php
-http://www.livehealthinsurance.com/quote3.php

QUOTE2.PHP: [variables are not passed to quote3.php]
http://www.livehealthinsurance.com/quote2.php
-insured_1_health_conditions – (radio button… yes or no)

-insured_1_health_conditions_details – (radio buttons… group of options… i.e. prior medical conditions)

QUOTE3.PHP: [Javascript doesn't work correctly]
http://www.livehealthinsurance.com/quote3.php
-only displays child forms when 2 or more children are selected from the “children” drop-down menu.

-doesn’t display the “continue button” until all 6 children are selected from the “children” drop-down menu.

-when all 6 children forms are displayed and the “continue button” is displayed at the bottom of the form, the formatting and styles of the form are affected.

-can’t change the display of children forms back to 0, once any number of children have been selected… you can only
change it back to 2 children forms displaying, and only if you do it in reverse sequential order. ex. 6…5…4…3…2

Terms & Conditions For Site

May 29th, 2009 Comments off

We require someone to adjust the TERMS AND CONDITIONS and PRIVACY POLICY for our free networking sales site.

The site is new. The current Terms & Conditions and Privacy Policy were copied from another site with adjustments made. We require someone to go through it and adjust it further, so that everything is appropriate and so that we are not liable. Experience with legal writing is a plus.

Please provide samples of previous work.

Thank you, and happy bidding!

Simple Website Design And Codi

April 26th, 2009 Comments off

Simple Website Design and Coding Request

We are looking for a webiste to be made for a private tutoring business concept. The website will be designed according to specific requirements
and coded into a fully working site using HTML and CSS.

Requirements:

- Site will conatain 9 pages; Home, About Us, Parents Role, Fees, Testimonials, FAQ’s, Contact, Terms & Conditions, Privacy
- All pages will have a common header, main menu and footer.
- All pages will have a link in the main menu except for Terms & Conditions and Privacy which will be linked in the footer.

Site Theme:

- The site is targeted at parents looking for private tutoring for their children. The key themes of the site are education and learning.

Site Color Scheme:

- The site must look proffesional and business like but at the same time look interesting, lively, relevant and fresh.
We like the colors used at t-mobile.co.uk, paticularly the pinks, blues, grays and whites.

Site Structure:

- The site will be relatively sparse in content so we need a design that will minimise white space and excessive scroling.

- A centered box layout as found at http://www.fantasiabeauty.co.uk/ would be ideal

Header:

- A unique logo must be designed. The logo will incorporate the name of the company and a tag line. The logo must be unique and attractive
as it will potentialy be used as the official company logo and appear in letterheads and such. Simply writing the companies name in a big bold
font will not be enough. Company name and tag line will be disclosed to the winning bidder.

- The header will contain the logo and whatever other graphic and / or design elements the designer wishes to use.

Footer:

- The footer will contain copyright information and links to ‘terms & conditions’ and ‘privacy’ pages

Pages:

- Consistent styling must be applied to all the pages of the site. Custom CSS must be written for all the major html tags, such as
<h1>, <h2>, <a>, <p>, <li> etc. Sample content will be provided for all pages.

- Each page will have a different image embeded on the right side of the content, as seen on www.fantasiabeauty.co.uk.
Each image should be relevant to the page subject aswell as the overall theme of the site. Images should be nicely blended into the template
and not look like they’ve just been stuck on.

- The ‘Fees’ page will contain a <table> so all table tags should be nicely styled. A sample table will be provided.

- The ‘Contact’ page will have a contact form. This needs to be provided by the winning bidder. An off the shelf secure PHP contact form
script may be used.
The form must be styled appropriately and contain a ‘Send Email’ submit button and the following input boxes;
Name, Tel/Mobile No., Email, Message.

Additional Information:

- As you can see the site is reletavely simple. We think simple static html pages will suffice, though if you want you can use a CMS such as wordpress
or Joomla. Please specify what you intend to do in your bids.

- Everything must be properly aligned and look good on all the major browsers, i.e. IE 5+, firefox, safari, chrome and opera.

- The site code should pass W3C validation.

Deliverables:

- PSD file for the logo work
- PSD file for the website layout work
- Copies of all images used for the website
- HTML, CSS and other necessary files for deployment of website

Please provide examples of previous work with your bids. Thank you!

Ebook For Arthritic Conditions

April 22nd, 2009 Comments off

This is a writing project that involves writing a short informative book. So I’m not expecting something huge – probably 35-50 pages max.
This project should be very simple for someone who is experienced in research/writing.
A competitive offer will lead to future work.

Platform:
The book needs to be in MS Word.

All deliverables must be uploaded to Scriptlance before the deadline(s) for this project…with no exceptions.

I would like the book written in MS Word using Verdana 12 point font.

1. 20,000 words and delivered as an MS Word file
2.I’ll review and approve the book to make sure it’s within specification.
3.7 chapters of about 2,500 words each. Each chapter will be a case study of a person who has experienced and overcome severe rheumatoid arthritis. The 7 people case-studied should have used a range of medical and/or alternative treatments. I will provide a list of interview questions for the case studies.
4) I’ll retain complete ownership and copyright and have exclusive right to use all work on my website and for direct mail.
5) It doesn’t matter to me if you use content from other websites to give you ideas for writing, just don’t copy the content and infringe on a copyright. All work must MUST BE ORIGINAL.
6) 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).

More detailed Specifications (Provided after bidding has
closed, and only to the chosen coder)

C Lemonade Stand

April 5th, 2009 Comments off

Here is what needs to be done. I have the skeleton code too which i have included right after the instructions. This program must compile in Dev C++ and it needs to be in the format in the instructions.

Objectives
1. Review use of if statements and loops.
2. Learn how to write functions given specifications.
3. Learn how to use pass by reference variables.
4. Learn how to put together a useful program given a skeleton of that program and the
functions and their specifications necessary in the implementation.

Problem: Lemonade Stand
Last summer your friend has a lemonade stand and made lots of money. You want to do the same! You have plenty of time to plan, so you thought you would be pre
pared when summer came around by writing a program to simulate your lemonade stand. The basic idea behind the simulation is as follows:

1) You will simulate 10 days of running the lemonade stand.
2) In the beginning the user gets a $20.00 loan to run the lemonade stand.
3) Before each day, the user gets an opportunity to buy bags of lemons and sugar.
4) At the beginning of each day the user receive a weather report.
5) Based on that, the user is asked to price a cup of lemonade for that day.
6) Then, the days sales are simulated. (Part of this is written for you.)
7) Afterwards, the user is prompted with a status report of how much money they have left and how many bags of lemons and sugar they have left.

What you have to do
A skeleton of the solution for this assignment is posted on WebCourses and the course web page. Please use this skeleton. You must fill in the seven functions that are left for you to fill in, as well as write the remainder of main so the program works as described above. After you write each function, you should test it before moving on. How to do this will be covered in class. Then, write your main, calling the necessary functions from it to achieve the desired functionality. main can work without declaring any new variables than the ones already declared. But, you may declare new ones if you wish.

Perhaps the biggest problem you will have will be not knowing when to make function calls. The goal of having these functions is to make the coding process more manageable. In particular, it is possible that a function might “do” something complicated, but that just really means that function makes calls to other functions that carry out a majority of that work already. In essence, if you write a function A to do a task, then don’t write out the code that also does that task in another function B. Instead call the function A from the body of function B.

References
Textbook: Chapters 9, 10, 11 Notes: Lectures 13, 14, 15, 17

Output Sample
Two full output samples of the program running will be provided on Webcourses and the course web page in the files lemonade.out and lemonade2.out.

Deliverables
You must submit your solution to the problem, lemonade.c, over WebCourses.

Restrictions
Although you may use other compilers, your program must compile and run using DevC++. Please use DevC++ to develop your program. Your program should include a header comment with the following information: your name, course number, section number, assignment title, and date. Also, make sure you include ample comments throughout your code describing the major steps in solving the problem.

Grading Details
Your program will be graded upon the following criteria:

1) Your correctness
2) Your programming style and use of white space. (Even if you have a plan and your program works perfectly, if your programming style is poor or your use of white space is poor you could get 10% or 15% deducted from your grade.)
3) Compatibility to DevC++. (If your program does not compile in this environment, you will get a sizable deduction from your grade, likely to be over 50%)

The code Skeleton:

#include &amp;amp;lt;stdio.h&amp;amp;gt;
#include &amp;amp;lt;stdlib.h&amp;amp;gt;
#include &amp;amp;lt;time.h&amp;amp;gt;

// Symbolic constants to be used.

// Prices of bags of sugar and lemon, respectively.
#define PRICE_LEMON 3.50
#define PRICE_SUGAR 2.00

// Fraction of a bag of lemons and sugar used on a single cup of lemonade.
#define LEMON_PER_CUP 0.03
#define SUGAR_PER_CUP 0.04

// The initial loan the user is given to start their lemonade stand.
#define START_MONEY 20.00

// Using symbolic constants for true and false.
#define FALSE 0
#define TRUE 1

void buy_lemons(double *pLemons, double *pMoney);
void buy_sugar(double *pSugar, double *pMoney);
int weather();
int num_cups_sold(int weather, int cost);
void status_report(double cash, double num_lemons, double num_sugar, int day);
int max_sell(double num_lemons, double num_sugar);
int get_cost();
void sell_cups(double *pMoney, double *pLemons, double *pSugar);
void end_message(double money);

int main() {

int num_day, ans;
double money = START_MONEY, num_lemons = 0, num_sugar = 0;

srand(time(0));

printf(“Welcome to the Game of Lemonade!nn”);
printf(“You start the game with $%.2lf and no supplies!n”, START_MONEY);

// Loop through each day. Ask the user if they want to buy lemons. If so,
// carry out the transaction. Then ask them if they want to buy sugar.
// If so, do this transaction as well. Then, let them sell lemonade for
// the day. Finally, print a status report after they’ve sold lemonade
// at the end of the day.
for (num_day = 1; num_day &amp;amp;lt;= 10; num_day++) {

}

// Print out whether or not they have lost money, broke even or gained
// money.

return 0;
}

// Pre-conditions: pLemons and pMoney are pointers to variables that store
// the user’s number of bags of lemons left and amount of
// money left.
// Post-condition: The user is given the opportunity to buy lemons. If
// successful, the number of bags of lemons and the amount
// of money the user has are adjusted accordingly.
//
// What to do in this function: If the user doesn’t have enough money to
// even buy one bag of lemons, tell them so and return. Otherwise, ask
// the user how many bags of lemons they want to buy. If they answer less
// than one, tell them they must get more and reprompt them. If they
// answer more than they can buy, tell them they don’t have that much
// money and reprompt them. Continue prompting them until they answer with
// a valid value. Then process the transaction.

void buy_lemons(double *pLemons, double *pMoney) {

}

// Pre-conditions: pSugar and pMoney are pointers to variables that store
// the user’s number of bags of lemons left and amount of
// money left.
// Post-condition: The user is given the opportunity to buy sugar. If
// successful, the number of bags of sugar and the amount
// of money the user has are adjusted accordingly.
//
// What to do in this function: If the user doesn’t have enough money to
// even buy one bag of sugar, tell them so and return. Otherwise, ask
// the user how many bags of sugar they want to buy. If they answer less
// than one, tell them they must get more and reprompt them. If they
// answer more than they can buy, tell them they don’t have that much
// money and reprompt them. Continue prompting them until they answer with
// a valid value. Then process the transaction.

void buy_sugar(double *pSugar, double *pMoney) {

}

// Pre-condition: None
// Post-condition: The weather report for the day is printed and the
// corresponding weather status in between 1 and 5,
// inclusive, is returned.
int weather() {

// Get the weather status value.
int retval = rand()%5 + 1;

printf(“nHere is today’s weather forecast:n”);

// Print out the appropriate forecast for that status.n”);
if (retval == 1)
printf(“It is cloudy with a high chance of rain.n”);
else if (retval == 2)
printf(“It is partly cloudy and windy.n”);
else if (retval == 3)
printf(“It is partly sunny with low humidity.n”);
else if (retval == 4)
printf(“It is warm and sunny with medium winds.n”);
else
printf(“It’s a perfect beach day. Sunny and hot!n”);

return retval; // Return this status value.
}

// Pre-condition: weather is an integer in between 1 and 5, inclusive,
// standing for the weather status for the day. cost is
// the cost of a cup of lemonade in cents for that day.
// Post-condition: The number of cups of lemonade for that day is returned.
int num_cups_sold(int weather, int cost) {

int optimal_price, max_cups;
double max_income;

// Calculate a maximum revenue for the day.
max_income = 5 + 3*weather;
optimal_price = 15 + 5*weather;
max_income = max_income – fabs(optimal_price – cost)/1.5;

// If it’s lower than 5 dollars, reset it to 5 dollars.
if (max_income &amp;amp;lt; 5)
max_income = 5;

// From this, determine the maximum number of cups that could be sold.
max_cups = (int)(max_income/((double)cost/100));

// Return a random number from 0 to this maximum.
return rand()%(max_cups+1);

}

// Pre-condition: cash is the amount of cash the user has, num_lemons is
// the number of bags of lemons the user has left, num_sugar
// is the number of bags of sugar the user has left, and day
// is which day of the game just finished.
// Post-condition: A status report with the four values passed in is nicely
// displayed for the user.
//
// What to do with this function: This is fairly self-explanatory from the
// pre and post conditions. Look to the sample given in the assignment for
// the format.
void status_report(double cash, double num_lemons, double num_sugar, int day) {

}

// Pre-condition: pMoney, pLemons and pSugar are pointers to the variables
// storing the user’s amount of cash, number of bags of
// lemons and number of bags of sugar.
// Post-condition: A day’s transactions will take place and the amount of
// money, the number of bags of lemons and sugar will be
// adjusted accordingly.
//
// What to do with this function: First prompt the user with the weather
// report. Then, ask the user for how much they want to sell a cup of
// lemonade. Determine the number of cups that actually get sold for the
// day by determining how many cups the user COULD sell based on the
// availability of supplies and how many cups they COULD sell based on the
// weather. Print out how many cups of lemonade they ended up selling.
// Then adjust the amount of money they have, as well as the number of bags
// of lemons and sugar.

void sell_cups(double *pMoney, double *pLemons, double *pSugar) {

}

// Pre-condition: num_lemons is the number of bags of lemons the user has,
// and num_sugar is the number of bags of sugar they have.
// Post-condition: The function returns the maximum number of cups of
// lemonade the user can sell based on available supplies.
//
// What to do with this function: Calculate how many full cups of lemonade
// you can supply with sugar. Do the same calculation for lemons. Then,
// return the smaller of these two values.

int max_sell(double num_lemons, double num_sugar) {

}

// Pre-condition: None.
// Post-condition: Returns the number of cents the user will sell a cup of
// lemonade for, for that day.
//
// What to do with this function: Prompt the user to enter how much they
// want to charge for a cup of lemonade. If they don’t enter a positive
// integer, reprompt them until they do. Then return this value.

int get_cost() {

}

// Pre-condition: money is the amount of money the user has left at the end
// of the 10 days of running their Lemonade Stand.
// Post-condition: The user’s overall loss or profit is printed out.

// What to do with this function: See if what they have left is less than
// what they started with. If so, print out how much the lost. If it’s equal
// just print out a message saying that they broke even. Otherwise, print
// out how much profit they made!

void end_message(double money) {

}

Categories: C/C++ Tags: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

Lemonade Stand

April 3rd, 2009 Comments off

Here is what needs to be done. I have the skeleton code too which i have included right after the instructions. This program must compile in Dev C++ and it needs to be in the format in the instructions.

Objectives
1. Review use of if statements and loops.
2. Learn how to write functions given specifications.
3. Learn how to use pass by reference variables.
4. Learn how to put together a useful program given a skeleton of that program and the
functions and their specifications necessary in the implementation.

Problem: Lemonade Stand
Last summer your friend has a lemonade stand and made lots of money. You want to do the same! You have plenty of time to plan, so you thought you would be pre
pared when summer came around by writing a program to simulate your lemonade stand. The basic idea behind the simulation is as follows:

1) You will simulate 10 days of running the lemonade stand.
2) In the beginning the user gets a $20.00 loan to run the lemonade stand.
3) Before each day, the user gets an opportunity to buy bags of lemons and sugar.
4) At the beginning of each day the user receive a weather report.
5) Based on that, the user is asked to price a cup of lemonade for that day.
6) Then, the days sales are simulated. (Part of this is written for you.)
7) Afterwards, the user is prompted with a status report of how much money they have left and how many bags of lemons and sugar they have left.

What you have to do
A skeleton of the solution for this assignment is posted on WebCourses and the course web page. Please use this skeleton. You must fill in the seven functions that are left for you to fill in, as well as write the remainder of main so the program works as described above. After you write each function, you should test it before moving on. How to do this will be covered in class. Then, write your main, calling the necessary functions from it to achieve the desired functionality. main can work without declaring any new variables than the ones already declared. But, you may declare new ones if you wish.

Perhaps the biggest problem you will have will be not knowing when to make function calls. The goal of having these functions is to make the coding process more manageable. In particular, it is possible that a function might “do” something complicated, but that just really means that function makes calls to other functions that carry out a majority of that work already. In essence, if you write a function A to do a task, then don’t write out the code that also does that task in another function B. Instead call the function A from the body of function B.

References
Textbook: Chapters 9, 10, 11 Notes: Lectures 13, 14, 15, 17

Output Sample
Two full output samples of the program running will be provided on Webcourses and the course web page in the files lemonade.out and lemonade2.out.

Deliverables
You must submit your solution to the problem, lemonade.c, over WebCourses.

Restrictions
Although you may use other compilers, your program must compile and run using DevC++. Please use DevC++ to develop your program. Your program should include a header comment with the following information: your name, course number, section number, assignment title, and date. Also, make sure you include ample comments throughout your code describing the major steps in solving the problem.

Grading Details
Your program will be graded upon the following criteria:

1) Your correctness
2) Your programming style and use of white space. (Even if you have a plan and your program works perfectly, if your programming style is poor or your use of white space is poor you could get 10% or 15% deducted from your grade.)
3) Compatibility to DevC++. (If your program does not compile in this environment, you will get a sizable deduction from your grade, likely to be over 50%)

The code Skeleton:

#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;
#include &lt;time.h&gt;

// Symbolic constants to be used.

// Prices of bags of sugar and lemon, respectively.
#define PRICE_LEMON 3.50
#define PRICE_SUGAR 2.00

// Fraction of a bag of lemons and sugar used on a single cup of lemonade.
#define LEMON_PER_CUP 0.03
#define SUGAR_PER_CUP 0.04

// The initial loan the user is given to start their lemonade stand.
#define START_MONEY 20.00

// Using symbolic constants for true and false.
#define FALSE 0
#define TRUE 1

void buy_lemons(double *pLemons, double *pMoney);
void buy_sugar(double *pSugar, double *pMoney);
int weather();
int num_cups_sold(int weather, int cost);
void status_report(double cash, double num_lemons, double num_sugar, int day);
int max_sell(double num_lemons, double num_sugar);
int get_cost();
void sell_cups(double *pMoney, double *pLemons, double *pSugar);
void end_message(double money);

int main() {

int num_day, ans;
double money = START_MONEY, num_lemons = 0, num_sugar = 0;

srand(time(0));

printf(“Welcome to the Game of Lemonade!nn”);
printf(“You start the game with $%.2lf and no supplies!n”, START_MONEY);

// Loop through each day. Ask the user if they want to buy lemons. If so,
// carry out the transaction. Then ask them if they want to buy sugar.
// If so, do this transaction as well. Then, let them sell lemonade for
// the day. Finally, print a status report after they’ve sold lemonade
// at the end of the day.
for (num_day = 1; num_day &lt;= 10; num_day++) {

}

// Print out whether or not they have lost money, broke even or gained
// money.

return 0;
}

// Pre-conditions: pLemons and pMoney are pointers to variables that store
// the user’s number of bags of lemons left and amount of
// money left.
// Post-condition: The user is given the opportunity to buy lemons. If
// successful, the number of bags of lemons and the amount
// of money the user has are adjusted accordingly.
//
// What to do in this function: If the user doesn’t have enough money to
// even buy one bag of lemons, tell them so and return. Otherwise, ask
// the user how many bags of lemons they want to buy. If they answer less
// than one, tell them they must get more and reprompt them. If they
// answer more than they can buy, tell them they don’t have that much
// money and reprompt them. Continue prompting them until they answer with
// a valid value. Then process the transaction.

void buy_lemons(double *pLemons, double *pMoney) {

}

// Pre-conditions: pSugar and pMoney are pointers to variables that store
// the user’s number of bags of lemons left and amount of
// money left.
// Post-condition: The user is given the opportunity to buy sugar. If
// successful, the number of bags of sugar and the amount
// of money the user has are adjusted accordingly.
//
// What to do in this function: If the user doesn’t have enough money to
// even buy one bag of sugar, tell them so and return. Otherwise, ask
// the user how many bags of sugar they want to buy. If they answer less
// than one, tell them they must get more and reprompt them. If they
// answer more than they can buy, tell them they don’t have that much
// money and reprompt them. Continue prompting them until they answer with
// a valid value. Then process the transaction.

void buy_sugar(double *pSugar, double *pMoney) {

}

// Pre-condition: None
// Post-condition: The weather report for the day is printed and the
// corresponding weather status in between 1 and 5,
// inclusive, is returned.
int weather() {

// Get the weather status value.
int retval = rand()%5 + 1;

printf(“nHere is today’s weather forecast:n”);

// Print out the appropriate forecast for that status.n”);
if (retval == 1)
printf(“It is cloudy with a high chance of rain.n”);
else if (retval == 2)
printf(“It is partly cloudy and windy.n”);
else if (retval == 3)
printf(“It is partly sunny with low humidity.n”);
else if (retval == 4)
printf(“It is warm and sunny with medium winds.n”);
else
printf(“It’s a perfect beach day. Sunny and hot!n”);

return retval; // Return this status value.
}

// Pre-condition: weather is an integer in between 1 and 5, inclusive,
// standing for the weather status for the day. cost is
// the cost of a cup of lemonade in cents for that day.
// Post-condition: The number of cups of lemonade for that day is returned.
int num_cups_sold(int weather, int cost) {

int optimal_price, max_cups;
double max_income;

// Calculate a maximum revenue for the day.
max_income = 5 + 3*weather;
optimal_price = 15 + 5*weather;
max_income = max_income – fabs(optimal_price – cost)/1.5;

// If it’s lower than 5 dollars, reset it to 5 dollars.
if (max_income &lt; 5)
max_income = 5;

// From this, determine the maximum number of cups that could be sold.
max_cups = (int)(max_income/((double)cost/100));

// Return a random number from 0 to this maximum.
return rand()%(max_cups+1);

}

// Pre-condition: cash is the amount of cash the user has, num_lemons is
// the number of bags of lemons the user has left, num_sugar
// is the number of bags of sugar the user has left, and day
// is which day of the game just finished.
// Post-condition: A status report with the four values passed in is nicely
// displayed for the user.
//
// What to do with this function: This is fairly self-explanatory from the
// pre and post conditions. Look to the sample given in the assignment for
// the format.
void status_report(double cash, double num_lemons, double num_sugar, int day) {

}

// Pre-condition: pMoney, pLemons and pSugar are pointers to the variables
// storing the user’s amount of cash, number of bags of
// lemons and number of bags of sugar.
// Post-condition: A day’s transactions will take place and the amount of
// money, the number of bags of lemons and sugar will be
// adjusted accordingly.
//
// What to do with this function: First prompt the user with the weather
// report. Then, ask the user for how much they want to sell a cup of
// lemonade. Determine the number of cups that actually get sold for the
// day by determining how many cups the user COULD sell based on the
// availability of supplies and how many cups they COULD sell based on the
// weather. Print out how many cups of lemonade they ended up selling.
// Then adjust the amount of money they have, as well as the number of bags
// of lemons and sugar.

void sell_cups(double *pMoney, double *pLemons, double *pSugar) {

}

// Pre-condition: num_lemons is the number of bags of lemons the user has,
// and num_sugar is the number of bags of sugar they have.
// Post-condition: The function returns the maximum number of cups of
// lemonade the user can sell based on available supplies.
//
// What to do with this function: Calculate how many full cups of lemonade
// you can supply with sugar. Do the same calculation for lemons. Then,
// return the smaller of these two values.

int max_sell(double num_lemons, double num_sugar) {

}

// Pre-condition: None.
// Post-condition: Returns the number of cents the user will sell a cup of
// lemonade for, for that day.
//
// What to do with this function: Prompt the user to enter how much they
// want to charge for a cup of lemonade. If they don’t enter a positive
// integer, reprompt them until they do. Then return this value.

int get_cost() {

}

// Pre-condition: money is the amount of money the user has left at the end
// of the 10 days of running their Lemonade Stand.
// Post-condition: The user’s overall loss or profit is printed out.

// What to do with this function: See if what they have left is less than
// what they started with. If so, print out how much the lost. If it’s equal
// just print out a message saying that they broke even. Otherwise, print
// out how much profit they made!

void end_message(double money) {

}

Categories: C/C++ Tags: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Bear