0 like 0 dislike

Question 10: Please write a program that can calculate tax 7% (0.07) of a product price, then outputs the tax and a total price including the tax.

Hint:

*Use %.2f for two decimal points*

*Printf a new line between the tax and a total price including tax*

Input1

80

Output1

5.60
85.60

 

Input 2

452

Output2

31.64
483.64

 

[Exam] asked in Final examination by (5.9k points)
Available when: Unlimited - Due to: 2018-01-17 16:30

edited by | 34 views

22 Answers

0 like 0 dislike
Hidden content!
* ** * * *
** ** * *

int main(){
** *** *** * float n,t,N;
* * **** *
* * * * * *** **** * *** ** *
* * * ****
* * * ** t=n*0.07;
** ** * * * N=n+t;
* **** *
** ** * ** * * *** * * * *
}
100/100 answered by (244 points)
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
Case 3: Correct output
0 like 0 dislike
Hidden content!
#include ***** * * * *
** ** * ** * * *

int main(int argc, char *argv[])
{
* *** ** * * ** price;
* ********* * * ** taxtotal, total;
** ******* *
* * * * **** ** *** * ** * **
** ** * * * = price * 0.07;
* * * *** * **** * *** ** ****
*** ** ** * = price + **** *
* * * * * * *** * *****
* ** ***** *** * * ** ** total);
* * **
** * ***** * * **** * * * * * **
**** * *** * * 0;
}
100/100 answered by (252 points)
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
Case 3: Correct output
0 like 0 dislike
Hidden content!
#include * * ** * *** *
#include * *** ***

int main(int argc, char *argv[])
{
* * **** ******* ** a;
* * ** * ** ** * ** ** * * * **
* *** ** * *** * ***** ** * * *** *** * * * * * * * *** *
****
******* * * *** ** * * * * * *  
** ******* * * ** 0;
}
100/100 answered by (269 points)
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
Case 3: Correct output
0 like 0 dislike
Hidden content!
* * * ** ** * * **
** * * * **

float price;
float tax;
* * *

int **** argc, char **

{
*** ** ** ** * * **** * ***
* ** *** * = * ***
** *** * * * = tax + *** *
* * * *** * ** * ** * * * tax);
** * ** * ****** *** ** ****

** ** * ** * 0;
}
100/100 answered by (268 points)
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
Case 3: Correct output
0 like 0 dislike
Hidden content!
**** *** *** * **

int main () {
* * * *** *
**** * * *** ** a; * * **** * ** ***** ****
** *** * * * * * *** * * *** * %0.2f\n", a*0.07);
** * * * ******* ** ** ***** * ** * * ** * ** * ** **
** ** ****** 0;
}
answered by (183 points)
0 0
prog.c: In function 'main':
prog.c:7:18: warning: unknown conversion type character 0xc in format [-Wformat=]
      printf("%0.2\fn",a+a*0.07);
                  ^
prog.c:7:13: warning: too many arguments for format [-Wformat-extra-args]
      printf("%0.2\fn",a+a*0.07);
             ^~~~~~~~~
0 like 0 dislike
Hidden content!
* ** **
* * * *

int main () {
  
* ** ** *** *** * a; **** * * * *
** *** * * * * * **** ***** ****** %f\n", a*0.07);
* *** ** * ** * ** * * ** ** *** * * * * *
* ** ** ** *** **** 0;
}
answered by (183 points)
0 0
prog.c: In function 'main':
prog.c:7:15: warning: unknown conversion type character 0xc in format [-Wformat=]
      printf("%\fn",a+a*0.07);
               ^
prog.c:7:13: warning: too many arguments for format [-Wformat-extra-args]
      printf("%\fn",a+a*0.07);
             ^~~~~~
0 0
prog.c: In function 'main':
prog.c:8:15: warning: unknown conversion type character 0xc in format [-Wformat=]
      printf("%\fn",a+a*0.07);
               ^
prog.c:8:13: warning: too many arguments for format [-Wformat-extra-args]
      printf("%\fn",a+a*0.07);
             ^~~~~~
0 like 0 dislike
Hidden content!
#include *** * **
#include * * * * **** * *

int main(int argc, char *argv[])
{
**** * **** ** * *** * a;
** ***** ** ** ******* ** *** *** ** * ** ** ** ** **
** ** * * *** ** ** * ***** *** ** ** * *
** ***** *
********* * * **** * * * * * ** * * *  
* * * ** * * 0;
}
100/100 answered by (243 points)
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
Case 3: Correct output
0 like 0 dislike
Hidden content!
#include <stdio.h>
#include ** ** * * * *

int main(int argc, char *argv[]) {
   
* * ***** *** **** **** * a;
** ** **** ** ** * **** * *** ** * * *
***** * *** * ** * * * **** * **** ** **
** ** ** * * * * * *** ** * * * * * * * * * * * * ** * ***** *** ** * ** *
* * * * * * * * * * * * * *** * * *** *** * * *
** * **** * ***** * * 0;
}
100/100 answered by (269 points)
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
Case 3: Correct output
0 like 0 dislike
Hidden content!
#include **** * ** ** * * *
#include * **** ** **

int main(int argc, char *argv[])
{
* * ** **** * * * * * * a;
* *** *** ** * * ** *** * ***** *
** * * * * * * * * * * * ***** * ** * * * *
* * * * *****
  
* ***** ** * * * * *** **** **
* * * * * ****** 0;
}
100/100 answered by (290 points)
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
Case 3: Correct output
0 like 0 dislike
Hidden content!
#include ** * * *
#include ** * ** ** * *

int main(int argc, char *argv[])
{
*** ** ****** *** ** a;
* * ** * ** * * ** *** ** *
* * * * * ** * * * ** **** * ** *** * **
* **** * * ** *
  
* * ** * * * * ** *** * * * * ***
***** * ** *** * * 0;
}
100/100 answered by (271 points)
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
Case 3: Correct output
Get it on Google Play Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English 中文 Tiếng Việt
IP:172.69.63.75
©2016-2019

Related questions

0 like 0 dislike
21 answers
[Exam] asked Jan 13, 2018 in Final examination by nat236919 (5.9k points)
Available when: Unlimited - Due to: Unlimited
| 95 views
0 like 0 dislike
30 answers
[Exam] asked Jan 13, 2018 in Final examination by nat236919 (5.9k points)
Available when: Unlimited - Due to: 2018-01-17 16:30
| 46 views
0 like 0 dislike
26 answers
[Exam] asked Jan 13, 2018 in Final examination by nat236919 (5.9k points)
Available when: Unlimited - Due to: 2018-01-17 16:30
| 32 views
0 like 0 dislike
21 answers
[Exam] asked Jan 13, 2018 in Final examination by nat236919 (5.9k points)
Available when: Unlimited - Due to: 2018-01-17 16:30
| 23 views
0 like 0 dislike
23 answers
[Exam] asked Jan 13, 2018 in Final examination by nat236919 (5.9k points)
Available when: Unlimited - Due to: 2018-01-17 16:30
| 30 views
8,792 questions
72,338 answers
47,172 comments
2,042 users