Menu
Coddy logo textTech

Taxing

Lesson 5 of 25 in Coddy's Coding Problems: Volume 2 course.

Create a program where you manage what a cash register does. You will receive three receipt inputs each with an amount (int) and tax percentage (int) calculate how much from the amount paid is tax. 

challenge icon

Challenge

Easy

Write a program that reads 4 receipts from standard input first inputting a number then a character.

  • A - 18% Tax
  • B - 10% Tax
  • C - 7% Tax

Output what the total amount of tax paid is

Input
10000 A
7500 B
18000 C
11500 B

Output
Total VAT paid: 4960

Try it yourself

#include <stdio.h>

int main() {
    // Write code here
    return 0;
}

All lessons in Coding Problems: Volume 2