求大神用C语言帮我编程一道题Write a C prigram that prompts the user for a cost per item,number of items purchased,and a discount rate.The progran should then calculate and print the total cost,discounted total cost,tax due,and amount due.

来源:学生作业帮助网 编辑:作业帮 时间:2024/04/29 21:48:08
求大神用C语言帮我编程一道题Write a C prigram that prompts the user for a cost per item,number of items purchased,and a discount rate.The progran should then calculate and print the total cost,discounted total cost,tax due,and amount due.

求大神用C语言帮我编程一道题Write a C prigram that prompts the user for a cost per item,number of items purchased,and a discount rate.The progran should then calculate and print the total cost,discounted total cost,tax due,and amount due.
求大神用C语言帮我编程一道题
Write a C prigram that prompts the user for a cost per item,number of items purchased,and a discount rate.The progran should then calculate and print the total cost,discounted total cost,tax due,and amount due.Use the formulas.
total cost = number of items * cost-per-item
total cost (discounted) = total cost - (discount rate * total cost)
tax due = total cost * TAXRATE
amount due = total cost + tax due
For this problem assume that the TAXRATE is 6%

求大神用C语言帮我编程一道题Write a C prigram that prompts the user for a cost per item,number of items purchased,and a discount rate.The progran should then calculate and print the total cost,discounted total cost,tax due,and amount due.
#include <stdio.h>
#include <math.h>
int main()
{
    double pCost,rate,totalCost,taxDue;
    int count;
    double taxRate = 0.06;
    printf("Please input the cost per item: ");
    scanf("%lf",&pCost);
    printf("Please input the number of items ");
    scanf("%d",&count);
    printf("Please input the discount rate: ");
    scanf("%lf",&rate);
    totalCost = count * pCost;
    taxDue = totalCost * taxRate;
    printf("The total cost is %lf\n",totalCost);
    printf("The discounted total cost is %lf\n",totalCost-rate*totalCost);
    printf("The tax due is %lf\n",taxDue);
    printf("Ths amount due is %lf\n",totalCost + taxDue);
    return 0;
}

求大神用C语言帮我编程一道题Write a C prigram that prompts the user for a cost per item,number of items purchased,and a discount rate.The progran should then calculate and print the total cost,discounted total cost,tax due,and amount due. 用梯形法编程求函数f(x)=x2+2x+1的定积分 求大神帮我把这个题有c语言或c++编出来,急用, 求大神做一道编程题 求大神帮组我C语言题目,已知函数Read sect(int sec)读一个扇区,sec为扇区号.函数write sect(int sec)写一个扇区,sec为扇区号,操作缓存区为buffer[512].编程试把数组char AA[]={‘1’,‘3’,‘5’,‘9’} 求大神给出用C语言编程生成正态分布随机数的程序,要不是标准正态分布的 一道用C语言编程计算积分的题目,求大神解答!可追分.一道用C语言编程的计算积分题目.用C语言进行3.14和3.15的数值计算,3.14中求使式子等于0 的x.其中n1是整数,其余都是分数.(0<p<a1/b1,X>=a 请高手帮我做一道c语言改错题. C语言编程求解释 求会英文的java大神帮忙解决一道编程题Write a program that will ask a user for the total hours worked.If the hours worked 求大神帮我算一道题.数学, 求地理大神帮我解一道题! 求大神帮我,.就这一道题. 求大神速度帮我做一道地理题 求大神帮我解一道高数题 急求C语言编程 求如下分段函数的值求求大神们 跪谢 能帮我做两道数值分析题么,用c语言编程,先给一百分,每打完一个题,我就提高悬赏. C语言编程题 -5 C语言编程 输入一段英语文本 判断单词数 字符数和空格.求大神...