Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Sep 2013
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Help on this mini project

    Write a program that prompts for the names of two (2) flowers and stores them. The program then displays the entered names from storage with labels. The names are then swapped in their storage locations, the first name is put in the second one's storage and the second name is put in the first one's storage. The names are then displayed again from storage with labels.

    No more than three variables are allowed for this part. You must output the two variables in the same order for the "Strings as entered" output and the "Switched strings" section. You can't just output each variable in reverse order. You actually need to swap the data from one variable into the other.

    Example:

    Strings as entered:
    variableOne: Rose
    variableTwo: Daisy

    Switched strings:
    variableOne: Daisy
    variableTwo: Rose

  • #2
    Senior Coder xelawho's Avatar
    Join Date
    Nov 2010
    Posts
    2,773
    Thanks
    55
    Thanked 518 Times in 515 Posts
    Seriously? This is the way you ask strangers to do your homework or you?

  • #3
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,732
    Thanks
    202
    Thanked 2,508 Times in 2,486 Posts
    Please have a look at forum rule #1.5. This forum is not a free coding service. As a general rule, the people helping out in this forum don't write code for others (especially code that appears to be for homework), but try to help with fixing code that doesn't work. You may perhaps get someone to write this script for you, but you'll be far more likely to get help if you have made a substantial effort and written some code yourself. Then someone here will almost certainly help you correct/improve your work.

    Code:
    var please = false;
    var thanks = false;
    if (!please && !thanks) {
    var interestLost = true;
    var moreHelp = 0;
    }



    Quizmaster: What are the first two books of the Old Testament?
    Contestant: Genesis and, er, Exorcist.

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.

  • #4
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    10,966
    Thanks
    0
    Thanked 236 Times in 233 Posts
    Quote Originally Posted by Philip M View Post

    Code:
    var please = false;
    var thanks = false;
    if (!please && !thanks) {
    var interestLost = true;
    var moreHelp = 0;
    }

    Code:
    var please = false;
    var thanks = false;
    var assignment = true;
    var postedcode = false;
    var 
    if ((!please && !thanks) || (assignment && !postedcode)) {
    	var interestLost = true;
    	var moreHelp = 0;
    }


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •