Results 1 to 4 of 4
  1. #1
    familyguy2's Avatar
    Join Date
    Jul 2013
    Gender
    male
    Location
    Behind you!
    Posts
    248
    Reputation
    10
    Thanks
    24
    My Mood
    Yeehaw

    Help me understand something

    What is initial ?



    Here is my code


    // Example program #1 from Chapter 5 of Absolute Beginners Guide (i recommend this book)
    // to C, 3rd Edition
    // File Chapter5ex1.c

    /* This is a sample program that list three kids and their school
    supply needs, as well as cost to buy the supplies */

    #include <stdio.h>

    main()
    {
    // Set up the variables, as well as define a few

    char firstInitial, middleInitial;
    int number_of_pencils;
    int number_of_notebooks;
    float pencils = 0.23;
    float notebooks = 2.89;
    float lunchbox = 4.99;


    //The information for the first child

    firstInitial = 'J';
    middleInitial = 'R';

    number_of_pencils = 7;
    number_of_notebooks= 4;

    printf("%c%c needs %d pencils, %d notebooks, and 1 lunchbox\n",
    firstInitial, middleInitial, number_of_pencils,
    number_of_notebooks);

    printf("The total cost is $%.2f\n\n", number_of_pencils*pencils
    + number_of_notebooks*notebooks + lunchbox);


    //The information for the second child

    firstInitial = 'A';
    middleInitial = 'J';

    number_of_pencils = 10;
    number_of_notebooks= 3;

    printf("%c%c needs %d pencils, %d notebooks, and 1 lunchbox\n",
    firstInitial, middleInitial, number_of_pencils,
    number_of_notebooks);

    printf("The total cost is $%.2f\n\n", number_of_pencils*pencils
    + number_of_notebooks*notebooks + lunchbox);

    number_of_pencils = 10;
    number_of_notebooks= 3;

    printf("%c%c needs %d pencils, %d notebooks, and 1 lunchbox\n",
    firstInitial, middleInitial, number_of_pencils,
    number_of_notebooks);

    printf("The total cost is $%.2f\n\n", number_of_pencils*pencils
    + number_of_notebooks*notebooks + lunchbox);

    //The information for the third child

    firstInitial = 'M';
    middleInitial = 'T';

    number_of_pencils = 9;
    number_of_notebooks= 2;

    printf("%c%c needs %d pencils, %d notebooks, and 1 lunchbox\n",
    firstInitial, middleInitial, number_of_pencils,
    number_of_notebooks);

    printf("The total cost is $%.2f\n\n", number_of_pencils*pencils
    + number_of_notebooks*notebooks + lunchbox);

    return 0;
    }
    Last edited by familyguy2; 12-28-2016 at 06:18 AM.
    I play dayz, send me pm if you whana some teame work.





  2. #2
    RoPMadM's Avatar
    Join Date
    Jul 2013
    Gender
    male
    Location
    __asm
    Posts
    226
    Reputation
    12
    Thanks
    251
    My Mood
    Cynical
    Next time please use code tags.

    [CODE']

    [/CODE']


    Initial in this case is the first letter of the name of the kid.
    Last edited by RoPMadM; 12-28-2016 at 02:04 PM.

  3. The Following User Says Thank You to RoPMadM For This Useful Post:

    familyguy2 (12-29-2016)

  4. #3
    familyguy2's Avatar
    Join Date
    Jul 2013
    Gender
    male
    Location
    Behind you!
    Posts
    248
    Reputation
    10
    Thanks
    24
    My Mood
    Yeehaw
    Quote Originally Posted by RoPMadM View Post
    Next time please use code tags.

    [CODE']

    [/CODE']


    Initial in this case is the first letter of the name of the kid.
    Oh ok, i understand now.
    I play dayz, send me pm if you whana some teame work.





  5. The Following User Says Thank You to familyguy2 For This Useful Post:

    RoPMadM (12-29-2016)

  6. #4
    Hugo Boss's Avatar
    Join Date
    Oct 2011
    Gender
    male
    Posts
    28,752
    Reputation
    4790
    Thanks
    5,902
    My Mood
    Angelic
    Seems like you got things solved.

     
    Super User since 08-29-2017
    Global Moderator from 10-02-2016 - 08-29-2017
    Premium Seller since 11-16-2016
    Moderator from 09-24-2015 - 01-09-2016
    Alliance of Valiant Arms Minion from 11-12-2015 - 01-09-2016
    Market place Minion from 09-24-2015 - 01-09-2016
    Crossfire Minion from 09-11-2015 - 01-09-2016

    Middleman from 07-07-2015 - 01-09-2016
    Market Place Minion from 03-03-2014 - 08-01-2014
    Middleman from 01-30-2014 - 08-01-2014
    Moderator from 03-29-2013 - 04-04-2013
    Market Place Minion from 03-07-2013 - 04-04-2013
    Premium Member since 01-25-2013
    Middleman from 12-04-2012 - 04-04-2013
    Registered since 10-9-2011

Similar Threads

  1. [Help Request] I need someone to help me on something
    By ozqx in forum Counter-Strike 2 Help
    Replies: 1
    Last Post: 04-22-2015, 03:48 AM
  2. [Help Request] Calling out people who understand something about amazon.
    By rename in forum Suggestions, Requests & General Help
    Replies: 1
    Last Post: 12-26-2014, 04:21 PM
  3. HELP me find something!!!
    By Battlefield 3 in forum Combat Arms Hack Coding / Programming / Source Code
    Replies: 5
    Last Post: 08-12-2010, 09:39 PM
  4. Can some one Help Me Get Something
    By ChikenLover in forum CrossFire Help
    Replies: 2
    Last Post: 06-02-2010, 02:12 PM
  5. Help: Virus or Something???
    By jeffrophin in forum General
    Replies: 14
    Last Post: 05-28-2010, 04:49 AM