Computer Science, asked by KaranKing9370, 2 months ago

Write an algorithm to convert feet into inches. Draw the flow chart also?

Answers

Answered by chetanreddy839
1

this thing is not letting me to say the answer

Answered by shahegulafroz
0

Algorithm:

// assuming we have string inputStr

string[] tokens = inputStr.Split ('.');

if (tokens.Length < 2 || tokens.Length > 2)

{

   throw new ArgumentException ();

}

int feet = int.Parse (tokens[0]);

int inches = int.Parse (tokens[1]);

if (inches >= 12)

{

   throw new ArgumentException ();

}

int totalInches = (feet * 12) + inches;

Similar questions