Created
September 26, 2015 15:43
-
-
Save anonymous/9db1daed46f0c2967700 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdlib.h> | |
#include<stdio.h> | |
int main() | |
{ | |
int type = 0, size = 0, castValue = size, origin = 0, euuk = 0, usuk = 0, europe = 28, usa = 4; | |
printf("This program is designed to convert all different sizes to UK equivalent. \n"); | |
printf("Please state a number corresponding to the item you would like to convert. \n 1. Shirt/T-Shirt \n 2. Trousers/Shorts \n 3. Dresses \n 4. Jumper/Hoodie/Sweatshirt \n", type); | |
scanf("%d", &type); | |
if (type == 1) | |
{ | |
printf("You have chosen 'Shirt/T-Shirt'. Please enter the size of the Shirt/T-Shirt. Please avoid using half-sizes or other non-whole values. \n", size); | |
scanf("%d", &size); | |
int castValue = size; | |
printf("Please choose where the Shirt/T-Shirt if from. \n 1. Europe \n 2. USA \n", origin); | |
scanf("%d", &origin); | |
euuk = castValue - europe; | |
usuk = castValue + usa; | |
if (origin == 1) | |
{ | |
printf("You have chosen 'Europe'. The UK equivalent of the size which you entered is %d \n", euuk); | |
} | |
else if (origin == 2) | |
{ | |
printf("You have chosen 'USA'. The UK equivalent of the size which you entered is %d \n", usuk); | |
} | |
else | |
{ | |
printf("That is an invalid choice. \n"); | |
} | |
} | |
else if (type == 2) | |
{ | |
printf("You have chosen 'Trousers/Shorts'. Please enter the size of the Trousers/Shorts. Please avoid using half-sizes or other non-whole values. \n", size); | |
scanf("%d", &size); | |
int castValue = size; | |
printf("Please choose where the Shirt/T-Shirt if from. \n 1. Europe \n 2. USA \n", origin); | |
scanf("%d", &origin); | |
euuk = castValue - europe; | |
usuk = castValue + usa; | |
if (origin == 1) | |
{ | |
printf("You have chosen 'Europe'. The UK equivalent of the size which you entered is %d \n", euuk); | |
} | |
else if (origin == 2) | |
{ | |
printf("You have chosen 'USA'. The UK equivalent of the size which you entered is %d \n", usuk); | |
} | |
else | |
{ | |
printf("That is an invalid choice. \n"); | |
} | |
} | |
else if (type == 3) | |
{ | |
printf("You have chosen 'Dresses'. Please enter the size of the Dress. Please avoid using half-sizes or other non-whole values. \n", size); | |
scanf("%d", &size); | |
int castValue = size; | |
printf("Please choose where the Shirt/T-Shirt if from. \n 1. Europe \n 2. USA \n", origin); | |
scanf("%d", &origin); | |
euuk = castValue - europe; | |
usuk = castValue + usa; | |
if (origin == 1) | |
{ | |
printf("You have chosen 'Europe'. The UK equivalent of the size which you entered is %d \n", euuk); | |
} | |
else if (origin == 2) | |
{ | |
printf("You have chosen 'USA'. The UK equivalent of the size which you entered is %d \n", usuk); | |
} | |
else | |
{ | |
printf("That is an invalid choice. \n"); | |
} | |
} | |
else if (type == 4) | |
{ | |
printf("You have chosen 'Jumpers/Hoodies/Sweatshirts'. Please enter the size of the Jumper/Hoodie/Sweatshirt. Please avoid using half-sizes or other non-whole values. \n", size); | |
scanf("%d", &size); | |
int castValue = size; | |
printf("Please choose where the Shirt/T-Shirt if from. \n 1. Europe \n 2. USA \n", origin); | |
scanf("%d", &origin); | |
euuk = castValue - europe; | |
usuk = castValue + usa; | |
if (origin == 1) | |
{ | |
printf("You have chosen 'Europe'. The UK equivalent of the size which you entered is %d \n", euuk); | |
} | |
else if (origin == 2) | |
{ | |
printf("You have chosen 'USA'. The UK equivalent of the size which you entered is %d \n", usuk); | |
} | |
else | |
{ | |
printf("That is an invalid choice. \n"); | |
} | |
} | |
else | |
{ | |
printf("This is an invalid choice. \n"); | |
} | |
system("pause"); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment