?
Solved

C programming question ?

Posted on 2000-05-01
11
Medium Priority
?
217 Views
Last Modified: 2010-04-02
Hi my name is Dwayne i need help with this question if you can help i would greatly appreciate it..

1.  A cattle feed company has two grades of feed, A and B. Feed A costs
$2.00 per pound and feed B costs $3.000 per 100 pounds. Ranachers can order a mixture of feeds A and B.

Write a progream that calculates the charg for feed order. The program should ask the user to enter the number of hundreds of pounds of feed A ordered. The program should display the amount of each type of feed ordered and its total cost of the order.

0
Comment
Question by:dwayne112
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
  • +4
11 Comments
 
LVL 1

Expert Comment

by:xelpmoc2
ID: 2767126
That sounds like a homework problem to me and we don't do homework at EE, if you start the program we can help you with it, but we won't do it for you.  If you have questions as to where to start ask that.
0
 
LVL 22

Expert Comment

by:nietod
ID: 2767127
We cannot provide answers to school assignments.  That is grounds for removal from this site.  (for both you and the experts involved.)  We can provide only limitied help in accademic assignments.    We can answer specific (direct) questions, like you might ask your teacher.  We can review your work and post suggestions, again, like your teacher might do.

Do you have specific questions?
Do you have any work on this (incomplete even) that we can review?
0
 
LVL 1

Expert Comment

by:ntdragon
ID: 2767349
as you see we can't do your homework for you
so try to do it yourself if you"ll have any problems ask and we will try to help you
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 33

Expert Comment

by:hongjun
ID: 2768838
Ya we cannot do your homework for you.

Hint: Try to work out the mathematical formula as to how to calculate the respective cost for the 2 grades. With the 2 formulas, you should be able to complete your practical assignment. The rest of the program is actually simple scanf and printf.

I am sure you can do it.

Good Luck
hongjun
0
 
LVL 1

Expert Comment

by:hewey01
ID: 2774229
In accordance with hongjun, my advice is:
Don´t think of the problem as a programming one, think of if a a math quiz, you must only do your math and then translate it into C, one way or another the programming is the easy part.

i.e.

math stuff

       a + b = c

programming part

printf's, scanf's, etc..
0
 

Author Comment

by:dwayne112
ID: 2775051
Thanks for all the help guys....and for responding so quickly

0
 
LVL 1

Expert Comment

by:xelpmoc2
ID: 2775110
Did you figure out the problem?  We want to help but we just can't give it to you.
0
 

Accepted Solution

by:
filia earned 200 total points
ID: 2779102
#include <stdio.h>

int A, B, costA, costB, cost;

main(){
printf("Enter Your charg pounds for feed A      ");
scanf("%d",&A);
printf("Enter Your charg pounds for feed B      ");
scanf("%d",&B);
costA = A * 2;
costB = B * 3;
cost = costA + costB;
printf("Feed A charged %d for %d $\n", A , costA);
printf("Feed A charged %d for %d $\n", B , costB);
printf("Total charg cost %d $\n", cost);
return 0;
}
0
 
LVL 1

Expert Comment

by:hewey01
ID: 2779682
Please do not screw up everybody else´s work. We were really willing to help, but not giving the answer right away.

HEWEY
0
 
LVL 22

Expert Comment

by:nietod
ID: 2805789
filia, providing complete answers to accademic questions violates the EE customer service agreement that you agreed to.  You can be removed from EE for this sort of violation.  Please refrain from doing so again.
0
 

Author Comment

by:dwayne112
ID: 2839637
I need to find the number of times the loop body executes and the value of the loop counter.

int i;
double f;

for (i = 0; i < 27; ++i)
printf("\n%d", i);


I came up with
#include <stdio.h>

main()
{
int i;
double f;

for (i = 1; i <= 27; ++i)
printf("\n%d", i;
}

output
45678910 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 27

thanks dwayne112  
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.
Suggested Courses
Course of the Month12 days, 18 hours left to enroll

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question