******** In Algorithm ********
Algorithm Variables price_1 , price_2 : reals Begin write(" Enter the amount exclusive of taxes:")
read(price_1) price_2 ← price_1 + price_1*0.2 if( price_2 > 200 ) then price_2 ← price_2 - price_2*0.15 write("the amount including VAT is : ",price_2) else write("the amount including VAT is :",price_2) next End
Result ==> Enter the amount exclusive of taxes : 180 the amount including VAT is : 183.6
******** In C ********
#include <stdio.h> int main() { float price_1 , price_2 ; printf(" Enter the amount exclusive of taxes:"); scanf("%f", &price_1); price_2 = price_1 + price_1*0.2 ; if ( price_2 > 200 ) { price_2 = price_2 - price_2 *0.15; printf("the amount including VAT is: %f ",price_2); }else{ printf("the amount including VAT is: %f ", price_2); } return 0; }
******** In C++ ********
#include <iostream> using namespace std; int main() { float price_1 , price_2 ; cout<<" Enter the amount exclusive of taxes:"; cin>>price_1; price_2 = price_1 + price_1 *0.2 ; if ( price_2> 200 ) { price_2 = price_2 - price_2 *0.15; cout<<"the amount including VAT is: "<<price_2; }else{ cout<<"the amount including VAT is: "<<price_2; } return 0; }
******** in Python ********
******** in Python ********
price_1= float(input("Enter the amount exclusive of taxes:"))
price_2 = price_1+ price_1*0.2
if price_2 > 200 :
price_2 = price_2 - price_2*0.15
print("the amount including VAT is: ",price_2)
else:
print("the amount including VAT is: ",price_2)
******** in JAVA ********
import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner sc = new Scanner (System.in);
System.out.print("Enter the amount exclusive of taxes:");
double Price_1 = sc.nextFloat();
double price_2 = Price_1 + Price_1*0.2;
if ( price_2 > 200 ) {
price_2 = price_2 - price_2*0.15;
System.out.print("the amount including VAT is: "+price_2);
}else{
System.out.print("the amount including VAT is: "+ price_2);
}
}
}
********* in C# *******
using System;
public class Ex10 {
public static void Main(string[] args)
{ double price_1, price_2;
Console.Write ("Enter the amount exclusive of taxes:");
price_1=double.Parse(System.Console.ReadLine());
price_2 = price_1+ price_1*0.2;
if ( price_2 > 200 ) {
price_2 = price_2 - price_2*0.15;
Console.Write("the amount including VAT is: "+price_2);
}else{
Console.Write("the amount including VAT is: "+price_2);
}
}
}
******** in JAVA ********
import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner sc = new Scanner (System.in);
System.out.print("Enter the amount exclusive of taxes:");
double Price_1 = sc.nextFloat();
double price_2 = Price_1 + Price_1*0.2;
if ( price_2 > 200 ) {
price_2 = price_2 - price_2*0.15;
System.out.print("the amount including VAT is: "+price_2);
}else{
System.out.print("the amount including VAT is: "+ price_2);
}
}
}
********* in C# *******
using System;
public class Ex10 {
public static void Main(string[] args)
{ double price_1, price_2;
Console.Write ("Enter the amount exclusive of taxes:");
price_1=double.Parse(System.Console.ReadLine());
price_2 = price_1+ price_1*0.2;
if ( price_2 > 200 ) {
price_2 = price_2 - price_2*0.15;
Console.Write("the amount including VAT is: "+price_2);
}else{
Console.Write("the amount including VAT is: "+price_2);
}
}
}