| | |
need help finishing the last pieces i haven't finshed yet using c
Please support our C advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Nov 2007
Posts: 38
Reputation:
Solved Threads: 0
can anyone help me finish my program please. thank you
c Syntax (Toggle Plain Text)
#include <stdio.h> #include <math.h> int main() { int product; float product1 = 2.98; float product2 = 4.50; float product3 = 9.98; float product4 = 4.49; float product5 = 6.87; float quantity = 1; double unitprice; float result; double total; printf( "Enter product number \n"); scanf("%f",&); printf( "Enter quantity : \n" ); scanf("%f",&); switch(product) { case 1: unitprice = 2.98; break; case 2: unitprice = 4.50; break; case 3: unitprice = 9.95; break; case 4: unitprice = 3.89; case 5: unitprice = 9.98; break; default: total = unitprice * quantity; printf( "total is:",total); } }
Last edited by Ancient Dragon; Feb 10th, 2008 at 8:15 am. Reason: add code tags
Sorry, but you seem to have missed several ReadMes in your rush to post. Firstly, we are not here to do your homework. We're happy to help and answer any question you may have, though. Secondly, use CODE tags when posting code! Without them code is very unreadable.
I'd like to know how you even expect us to figure out what the rest of your assignment is without you telling us.
I'd like to know how you even expect us to figure out what the rest of your assignment is without you telling us.
"Technological progress is like an axe in the hands of a pathological criminal."
All my posts may be freely redistributed under the terms of the MIT license.
All my posts may be freely redistributed under the terms of the MIT license.
•
•
Join Date: Nov 2007
Posts: 38
Reputation:
Solved Threads: 0
a mail order hopuse sells five different products whose retail prices are shown below
product number retail price
1-5 2.98,4.50,9.98,4.49,6.87
your program should use a switch statements to help determine the retail price for each product. your program shoulds also calculate and display the total retail value of all products sold last week.
product number retail price
1-5 2.98,4.50,9.98,4.49,6.87
your program should use a switch statements to help determine the retail price for each product. your program shoulds also calculate and display the total retail value of all products sold last week.
•
•
•
•
i havent tried it yet caz i'm stuck here what shud i put after & so it can work?
printf( "Enter product number \n");
scanf("%f",&);
printf( "Enter quantity : \n" );
scanf("%f",&);
C Syntax (Toggle Plain Text)
int product; scanf( "%d", &product ); int quantity; scanf( "%d", &quantity );
"If it moves, tax it. If it keeps moving, regulate it, and if it stops moving, subsidize it" - Ronald Reagan
![]() |
Other Threads in the C Forum
- Previous Thread: print integers not divisible by 2 and 3 between 1 and 100
- Next Thread: How do I compile and, more impotantly, Hello World
| Thread Tools | Search this Thread |
Tag cloud for C
adobe ansi api array arrays bash binarysearch centimeter char convert copyanyfile copypdffile cprogramme createcopyoffile createprocess() csyntax directory dynamic fflush file fork frequency getlasterror givemetehcodez global graphics gtkgcurlcompiling hardware highest homework i/o ide inches infiniteloop initialization interest kilometer km lazy linked linkedlist linux linuxsegmentationfault list locate logical_drives match matrix meter microsoft motherboard multi mysql open opendocumentformat opensource openwebfoundation owf pattern pdf performance pointer pointers posix power problem probleminc program programming pyramidusingturboccodes read recursion recv repetition scanf scheduling segmentationfault send shape single socketprograming socketprogramming spoonfeeding stack standard strchr string strings structures suggestions system systemcall test testautomation unix user voidmain() wab win32api windows.h






