CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Mar 2011
    Posts
    1

    Talking Please!!! Help me build this program

    The question is

    The mass of an empty gas jar, together with its glass cover plate, was 478.0g. When completely filled with water and cover plate fitted the mass was 1508.2g. An oven dried sample of soil was inserted in the dry gas jar and the total mass, including the cover plate, was 676.6g. Water was added to the soil and, after a suitable period of shaking, was topped up until the gas jar was brimful. The cover plate was fitted and the total mass was found to be 1632.6g. Determine the particle specific gravity of the soil. Given the formula to find the particle specific gravity (Gs) is as follow:

    Gs = Mass of dry soil/Mass of same volume of water

    Write a program to compute the value of Gs with soil type as input. Please write down your analysis and design in the sheet attached. State clearly the other formula that you may use to find the solution. In order for you to find the value of Gs you need to find the following values as according to the problem above:

    a) Mass of soil + water(massSoilWater)
    b) Mass of dry soil(massDrySoil)
    c) Mass of water present with the soil(massOfWaterInSoil)
    d) Mass of water when gas jar is full (massOfJarWater)
    e) Mass of water of a same volume as soil(massWaterVolSoil)

    The program must produce a correct soil name based on the Gs obtained above. Use the following table to decide the soil name:

    Type of Soils Gs Name Of Soils
    Very Coarse Soils >=600.00 Boulders
    >=400.00 but <600.00 Cobbles

    Coarse Soils >=500.00 Gravel
    >=200.00 but <500.00 Sand

    Fine Soils >=100.00 Silt
    >0.00 but <100.00 Clay

    p/s
    please...help me....i'm still newbie to C++ programming....

  2. #2
    Join Date
    Oct 2005
    Location
    England
    Posts
    803

    Re: Please!!! Help me build this program

    What have you done so far?
    Break the problem down and tell us what part you are having trouble with.
    Rich

    Visual Studio 2010 Professional | Windows 7 (x64)
    Ubuntu

  3. #3
    Join Date
    Feb 2002
    Posts
    4,640

    Re: Please!!! Help me build this program

    Code:
    #include <iostream>
    
    int main()
    {
       std::cout << "Start here!" << std::endl;
    }
    Viggy

  4. #4
    Join Date
    Aug 2009
    Posts
    440

    Re: Please!!! Help me build this program

    Quote Originally Posted by MrViggy View Post
    Code:
    #include <iostream>
    
    int main()
    {
       std::cout << "Start here!" << std::endl;
    }
    Viggy
    This. You'll find people are far more likely to help you if you specify where you are having troubles with.

  5. #5
    Join Date
    Jun 2009
    Location
    France
    Posts
    2,513

    Re: Please!!! Help me build this program

    Quote Originally Posted by Alterah View Post
    This. You'll find people are far more likely to help you if you specify where you are having troubles with.
    Viggy is not the OP, he was just giving a starting point.
    Is your question related to IO?
    Read this C++ FAQ article at parashift by Marshall Cline. In particular points 1-6.
    It will explain how to correctly deal with IO, how to validate input, and why you shouldn't count on "while(!in.eof())". And it always makes for excellent reading.

  6. #6
    Join Date
    Aug 2009
    Posts
    440

    Re: Please!!! Help me build this program

    Quote Originally Posted by monarch_dodra View Post
    Viggy is not the OP, he was just giving a starting point.
    I know. I was just pointing out that the type of help Viggy gave isn't really helpful in answering the problem; however, this is the nature of the help the OP will get unless he/she is more specific with the kind of help needed. Also, showing effort typically makes the responses more helpful.

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured