C++ :: Program To Convert Meters To Feet

Mar 28, 2013

(Program) a. Write a C++ program to convert meters to feet. The program should request the starting meter value, the number of conversions to be made, and the increment between metric values. The display should have appropriate headings and list the meters and corresponding feet value. If the number of iterations is greater than 10, have your program substitute a default increment of 10. Use the relationship that 1 meter = 3.281 feet.

b. Run the program written in Exercise 6a on a computer. Verify that your program begins at the correct starting meter value and contains the exact number of conversions specified in your input data.

here is what have so far

#include<iostream>
#include <iomanip>
using namespace std;
// a programs to convert meter to feet
int main() {
const int MAXMETER = 10;

[Code] ....

I don't know how to have a setup where you input the values, and then will be provided the output.

View 4 Replies


ADVERTISEMENT

C++ :: Convert Feet And Inches Into Meters And Centimeters

May 9, 2013

I am new to c++, and I have been going through some basic code to get used to the syntax etc. I have encountered a compiling issue with my current code. The purpose of this code is to convert feet and inches into meters and centimeters.

#include <iostream>
#include <cmath>
using namespace std;
int main () {
<<<xcode is saying I have an expected expression on this blank line>>>
double feet1, inch1, inch2, meter1, centimeter1;

cout << "Please enter a length in feet and inches " << endl;
cin >> feet1 >> inch1 >> ;

I have tried rewriting the #include through int main () expressions, I've tried copy/pasting the lines from other pieces of code...

View 5 Replies View Related

C++ :: Convert Centimeters To Yards Feet And Inches

Jul 14, 2013

I have to write a code to convert centimeters to yards feet and inches i have the code wrtten up and keep getting 2 errors saying im missing a ; before << but im not sure why ?

#include <iostream>//For cin and cout
using namespace std;
int main(void) {
doublecentimeters; //INPUT

[Code] ....

View 2 Replies View Related

C :: Convert Inches To Yards / Feet And Inches

Jul 25, 2014

I was given an assignment to enter two sets of numbers for yards, feet, and inches, and then add them together and convert it to inches. That part of the program is correct, but now I need to calculate the area. It is a working program, but my final answer is in inches, and it is supposed to be in yards, feet, and inches. How do I convert the calculated inches back to yards, feet, and inches?

Code: typedef struct {
int yards;
int feet;
float inches;

} yardfeetinches;
typedef struct {

[Code] ....

View 2 Replies View Related

C/C++ :: Program That Adds Feet As Well As Inches And Outputs In Inches?

Apr 4, 2015

This program must take user input(from stdin) that contains both a number and then a punctuation character, either a single quote(') or double quote(") that specifies feet or inches. It keeps prompting the user to enter a length until the user enters the sentinel value of 0. For example:

Enter a measurement and unit: 1'
Enter a measurement and unit: 2"
Enter a measurement and unit: 0
Total: 14 inches

The ultimate goal of this program is to then write an Assembly language program that is structurally similar and makes use of these 4 functions:

void printStr(char *)
Arguments:
edi = address of null-terminated string to print
Returns:
Nothing

[Code] ...

So here is what I have:

int main() {
char value[50];
char *end;
int sum = 0;
long conv;
while(conv !=0)

[Code] .....

I was told to use fgets instead of scanf for for stdin to parse the number and the quotation marks. I think I converted the number from string to integer correctly with strtol, but I really do not know how to obtain the (") or (') from user input so the program knows whether to convert the number to feet or just inches. No matter what I type in, even if it's without a quotation mark, it still multiplies the number by 12. In the IF and ELSE IF statement, it should state

if(value = ''')
and...
else if(value = '"')

View 4 Replies View Related

C++ ::  Converting Feet To Inches As A Decimal

Oct 21, 2014

I have my program all but done, but I can't get past this last part. I need to have the user input their height as a decimal. For example someone who is 5 foot 11 inches would need to enter it as 5.11, then I need to display there height in inches. Since i'm 5 foot 11, I would need to enter 5.11, then have it display 71 inches.

View 4 Replies View Related

C++ ::  Looping Simple Menu - Calculate Dimensions Of Floor Plan In Square Feet?

Oct 2, 2013

What I'm trying to accomplish is to ask the user what their floor plan is (in square feet), have them pick what kind of material they want and give them a general price.

Which is working out great so far, but I would also like to add a loop at the end that cycles back if they want to re-do the estimate with a different material selection and if not exit out the program.

I've been trying do while and if/else loops but i can't get them to work right.

#include <iostream>
#include <string>
using namespace std;
int main() {
string custName, selection;
int custNumber, floorSize, material, contactSystem;

[Code] ....

That's basically what I've come up with so far minus all the erroneous attempts. Though as is I technically complete the assignment, I would like the extra credit from making the last part loop.

View 1 Replies View Related

C :: Program To Convert Bits To Bytes

May 13, 2013

I made this program to convert bits to bytes, because I'm so sick of seeing ISP's advertise speeds in megabits, which I consider an intentional attempt to decieve :P And I think I've finally understood how the return value of scanf works since the last time I posted here, so my program can check to see if an integer was entered before processing the input, but I'm stuck on how to make the whole program start over if an integer is not entered. I have a hunch it would involve a loop, but I can't figure out how to make the program start over at "How many mb do you need converted?" if an integer is not entered into scanf..Here is the code I have so far:

Code:

#include <stdio.h>
int main () {
int b, mb, kb, Byte, kB, mB, gB;
char term;
}

[code]....

and my program makes the assumption for now at least, that mb will be inputted because that's the unit of measurement that i usually see advertised, and i didn't bother making an if statement to print a conversion in terms of gigabytes because i've never heard of a connection that fast :P

View 5 Replies View Related

C :: Program That Uses Tolower To Convert Strings Into Lowercase?

Oct 6, 2014

Any simple program that uses tolower to convert strings into lowercase? Or simply just the general syntax of tolower pls. Can find it in google.

View 5 Replies View Related

C :: Program To Convert A Number Into A More Readable Format

Oct 14, 2014

I wanted to write a program to convert a number into a more readable format. It's like, if the input enters the number as 2361263 the output should be like 2,361,263. I went about this problem like extraction the number first and then if the count was equal to multiple of three i'd print ',' instead of the number.

But initially when i wrote the code for extracting a single digit from the number

Code:

#include<stdio.h>
void main() {
unsigned long long num=pow(2,50);
int count=0;
while(num!=0) {
int last_digit;

[Code]....

I know that I'd lose the number when i finish printing it, but still I only end up printing the entire number in reverse order.

As in if the input is 1234 the output is 4,321 which is not what i want.

One way of overcoming this problem is to store the values in an array and then reading then back from the end. But i wanted to know if there is a better solution than this? To extract the digits from the number in the same order as it is in the number

View 5 Replies View Related

C++ :: Program To Convert Octal Number To Decimal

Mar 27, 2013

I nead to write a program that convert an octal number to decimal number, I thought I did it right but it doesn't work.. I have to use in the first for loop as it is because it is part of the instructions (student homework).

#include <iostream>
#include <math.h>
using namespace std;
void main() {
double numOfDig, num, newNum;

[Code] ....

View 1 Replies View Related

C++ :: Program To Convert Int To Char Array Without Symbol

Apr 17, 2014

I'm writting program and need to convert int ot char array without simbol. I have tryed snprintf , but his returns array full of simbols if it is initilized elsware return full of garbidge. Is there any elegent way to aceave this? What I'm trying to aceave is liek this:

char buffer[10];
int temp = 1231423;
// Do conversation...
// After conversation char array should look like this
// 1 2 3 1 4 2 3 _ _ _
// without simbol

View 2 Replies View Related

C++ :: Program To Convert Timestamp To Hour And Days

Jan 17, 2015

I need to write a program that converts timestamp to hour and days.

View 2 Replies View Related

C++ :: Conversion Program To Convert Kilograms To Pounds

Oct 7, 2012

I need to create a conversion program to convert kilograms to pounds. The user will enter a number for weight and a char for unit of measurement K= kilo or P=pound and the program should display the other corresponding weight.

View 2 Replies View Related

C++ :: Convert Pseudo Code Into Program For Searching Value Of Array

Jun 29, 2014

What is the program of this pseudo code?

Set found to false.
Set position to -1.
Set index to 0.
While found is false and index < number of elements
If list[index] is equal to search value
found = true.
position = index.
End If
Add 1 to index.
End While.
Return position

View 5 Replies View Related

C++ :: Creating Program With Parameters To Convert Pounds To Euros

Jan 22, 2015

m creating a program with parameters to convert pounds to euros.

I keep getting this errorc2447: '{' missing function header for the line 'void showPriceInEuros' ....

#include <iostream> //for cin >> and cout <<
#include <cassert> //for assert
#include <iomanip> //for endl
#include <Windows.h>
using namespace std;
void processAPrice();
int getPriceInPounds();
int convertPriceIntoEuros(int pounds);

[Code] ....

View 1 Replies View Related

C Sharp :: Convert Log Parsing Program Written In Perl

Feb 13, 2013

Following is a script written in perl :

#Number of bugs edited in Watson Express  
#find server*/watson*/log/ -name "watson*" -type f  -newer  ./tmpoldfile ! -newer  ./tmpnewfile  | 
xargs grep "WX Edit Bug" | awk '{print $8}' | sort | uniq  | wc -l  
// 

this is log parsing string in perl based on bash file.

Need a log parsing program in C# for the same.....

View 1 Replies View Related

C++ :: Program To Convert From Fahrenheit To Celsius - Linking Error?

Jan 6, 2013

So here is the program:

//Program to convert from Fahrenheit to Celcius
#include <iostream>

double fahrenToCelsius (double t);
//precondition:
//t is a valid tempreture in Fahrenheit
//postcondition:
//returns equivalent temp. in Celcius

[Code] .....

And here is the problem:
[Linker error] C:UsersOwnerAppDataLocalTempcckex8SZ.o:fahrenToCelsius.cpp: (.text+0x3d): undefined reference to `fahrenToCelsius(double)'
collect2: ld returned 1 exit status

I'm suspecting the program maybe that I saved it wrong? I saved it as fahrentoCelsius.cpp inside the folder "Work" ( I created this folder) which is inside the folder "Dev-cpp".

View 1 Replies View Related

C/C++ :: Convert Infix To Postfix Using Linked Lists And Stacks - Program Stop Working After 1st Call

Sep 28, 2014

I was given a task to convert infix to post fix using both linked lists and stacks in the code so this is what i have written but the problem is it is giving me same error at three different places "missing function header(old style format?)

#include <iostream>
#include <string>
using namespace std;
const int size = 100;
class stack{
private: // Declare a structure for the list

[Code] ....

View 12 Replies View Related

C++ :: Class Template Convert Which Can Convert Itself To Any Data Type

Sep 23, 2012

Code:
template<class T>
class Convert {
T data;
public:
Convert(const T& tData = T()) : data(tData)

[Code] ....

Why do we use operator? Is float and double function names below?

Code:
Convert<int>::operator<float> float();
Convert<int>::operator<double> double();

View 1 Replies View Related

C++ :: Program To Convert Normal Text To Mobile Text

Mar 26, 2013

Program that reads in a normal text file and converts it into mobile phone text. that is if the word is 3 characters or less then ther is no changes to the word and if the word is four or more letters then remove all the vowels from the word except for vowels that are capitals.

View 5 Replies View Related

C++ :: Write Program To Convert Time From 24-hour Notation To 12-hour Notation

Dec 10, 2013

Write a program to convert the time from 24-hour notation to 12-hour notation and vice versa. Your program must be menu driven, giving the user the choice of converting the time between the two notations. Furthermore, your program must contain at least the following function: a function to convert the time from 24-hour notation to 12-hour notation, a function to convert the time from 12-hour notation to 24-hour notation, a function to display the choices, function(s) to get the input, and function(s) to display the results. (For 12-hour time notation, your program must display AM or PM.)

Answer:

#include <iostream>
#include <iomanip>
#include <cmath>

[Code]....

It is showing error because may be I was not able to put that if statement inside any function. find out the error sand complete the program with corrected code.

View 2 Replies View Related

C :: How To Convert PPM Into JPG

Nov 17, 2013

I captured .ppm from avi file. How can I convert .ppm into .jpg only using C.

View 3 Replies View Related

C++ :: Can't Convert To Hex

Mar 30, 2014

I was assigned a problem involving using buffer overflow to access a different function than I was supposed to. I was able to figure out how to modify the point in stack that I need to change using a printf statement, however what doesn't make sense is that when I use the input "AABBCCDDEEFFGGx86x64x00x00" the stack changes to 78363878 I looked up the ascii codes and I assume that it's not converting x86, but using the input x86 instead.

View 4 Replies View Related

C++ :: Can't Convert Char To Int

Nov 9, 2013

I am writing a basic keylogger and i want to add data to log file, but it says that i cant convert char to int. Everything else works fine.

Code:
#include <iostream>#include <windows.h>
#include <stdio.h>
#include <time.h>
using namespace std;

[Code] ....

View 3 Replies View Related

C :: How To Convert Char To Int

Nov 24, 2014

Example

char A[4]
gets(A) --> 1234

View 11 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved