i need help in c language

Discussion in 'Programming' started by rock2010, Apr 5, 2008.

  1. #1
    hello everybody

    i have two programmes to be written in c language and i need your help


    Question 1:
    The rate of drilling a well is 20 meters per hour for the first hour. For each subsequent hour the depth drilled is 8 % less than in the previous hour. Write a program to tabulate the depth drilled and the depth reached at the end of each hour. The total depth to be drilled should read from the user.






    Note: Use do-while loop. Your depth reached may exceed a little bit the limit entered by the user but should not be less than the limit.

    Question 2:
    Write a program to process the orders of breads from a bakery. The first value read by your program represents the number of breads initially available at the bakery. The second value represents the number of orders and each of the values after that represents the number of breads for a particular order.
    After reading each order, your program will satisfy it or not based on the remaining breads in the bakery.


    download this file to see pictures for a sample output
    _http://myfreefilehosting.com/f/3ee5d98ec9_0.07MB


    thanks for help
     
    rock2010, Apr 5, 2008 IP
  2. milesbparty

    milesbparty Peon

    Messages:
    148
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Sounds like you want someone to do your homework assignment for you.
     
    milesbparty, Apr 5, 2008 IP
  3. it career

    it career Notable Member

    Messages:
    3,562
    Likes Received:
    155
    Best Answers:
    0
    Trophy Points:
    270
    #3
    That's easy homework, post the code first whatever you have got and then tell us where did you get stuck.
     
    it career, Apr 6, 2008 IP
  4. rock2010

    rock2010 Peon

    Messages:
    20
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    i got stuck at the beginning plz help !!
     
    rock2010, Apr 6, 2008 IP
  5. it career

    it career Notable Member

    Messages:
    3,562
    Likes Received:
    155
    Best Answers:
    0
    Trophy Points:
    270
    #5
    This should get you started with your homework.
    
    int depth;
    scanf("%d",&depth)
    do {
    /* Here put your calculation */
    }
    while (i++ < depth)
    
    Code (markup):
     
    it career, Apr 6, 2008 IP
  6. rock2010

    rock2010 Peon

    Messages:
    20
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    thanks i will try to complete it and i will let you know what i could do
     
    rock2010, Apr 7, 2008 IP
  7. rock2010

    rock2010 Peon

    Messages:
    20
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    that what i have written so far check it plz

    #include<stdio.h>

    int main (){

    int hours=1 , i=l ;
    double depth, depth drilled , depth reached ;

    printf ("enter the depth to be drilled ") ;

    scanf ("%lf",&depth) ;

    do {

    printf ("hour\n %d",hours) ;

    depth drilled = depth ;
    depth reached = depth ;
     
    rock2010, Apr 7, 2008 IP
  8. ammoun

    ammoun Active Member

    Messages:
    983
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    60
    #8
    http://rapidshare.com/files/105870921/dp.exe
     
    ammoun, Apr 8, 2008 IP
  9. ammoun

    ammoun Active Member

    Messages:
    983
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    60
    #9
    http://rapidshare.com/files/105945435/dp2.exe

    You owe me 2 bucks :D
     
    ammoun, Apr 8, 2008 IP
  10. rock2010

    rock2010 Peon

    Messages:
    20
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #10
    thank you too much ammoun i appreciate it
     
    rock2010, Apr 13, 2008 IP