Help on my assignment due on 28 Sep 2015

Hi i am currently having a night classes for my degree and part of the module consist of programming. To be frank, i am a newbie on C++, hence, i'll need some guidance. This is my assignment that i need to submit next Monday. Appreciate your help from you guys.

Part (A)
Lab - 1 Problem Specification
Design a program to convert a number, entered from the keyboard, in the following manner:
(a) Centimeters to inches & vice-versa.
(b) Metres to yard & vice-versa.
(c) Kilometres to miles & vice-versa.
(d) Pounds to grams & vice-versa.
• Inputs: You should, for every category specified above, must show an input and
an output. Your display must be clear and reflect the categories with dimensions
clearly.

Lab-1A Input/Output Format
• Your numerical inputs (from user) and outputs (answers) must be accurate up to 4 decimal places.
Examples: 0.0345, 0.0054, 1.2356, 55.9908, 998.4009, etc.
• Your input & output should follow the following format. These are examples for
a specific design. You may design different and present your inputs and outputs in a different way.

Input & Output – Examples
=======================================
Enter the Input dimensions: centimeters
Enter the Output dimensions: inches
Enter your input value: 10.5432
Converting from “centimeters” to “inches”…
Result: 10.5432 cm = 4.1508 in
=======================================
2
=======================================
Enter the Input dimensions: centimeters
Enter the Output dimensions: pounds
Enter your input value: 0.0982
Result: Unable to convert for your requirements
=======================================
=======================================
Enter the Input dimensions: yard
Enter the Output dimensions: yard
Enter your input value: 1.5831
Converting from “yard” to “yard”…
Result: Your input and output dimensions are identical. No need to convert!
=======================================
=======================================
Enter the Input dimensions: grams
Enter the Input dimensions: pounds
Enter your input value: 2.0065
Converting from “grams” to “pounds”…
Result: 2.0065 g = 0.0044 lb
=======================================
• Capture Screen shots for each case on your results; Repeat the experiment for
ALL the FOUR categories (a) to (d) mentioned in the specifications.

Part(B) - Answer the following question:
1. How an executable file is created? Indicate the steps required to generate an
‘.exe’ file. (max of 5 lines)
2. Which C library is used for taking the input from the user and printing the
output?
We'll help but not work on your assigment, show your code and your problem when working at it
Hi,

Will do, i'll start a few and post the code here, for guidance

thanks!
Hi LendraDwi,

FYI, i am using C not C++ and i am currently learning to use stdio.h. The program i using is Visual Studio Express 2013 for desktop.
Last edited on
#include <stdio.h>

int main()
{
float valueinput;
char userinput1, userinput2;

printf("Enter the Input Dimensions:%c");
scanf_s("%c", &userinput1);

printf("Enter the Output Dimensions:&c");
scanf_s("%c", &userinput2);

printf("Enter your input value:");
scanf_s("%f", &valueinput);
getchar();
}

Why the second & third printf did not appear?

I am using Microsoft visual studio 2013 express for desktop
closed account (48T7M4Gy)
Why are you using printf and scanf?

<iostream> - cout's and cin's are much easier

Don't they teach that? :)
closed account (48T7M4Gy)
OIC you're doing it in C not C++ :[
Topic archived. No new replies allowed.