Question:
Can you help me with the C++ programming code of this?
Joe
2011-08-14 20:53:41 UTC
Make a program that will accept 5 numbers and will display the number with the highest and lowest value, depending on the option of the user then display its square root. The program should accept only numerical characters and will display an error message if the entries are invalid.
Three answers:
F2568
2011-08-15 10:51:03 UTC
this is the pseudo code:



methodname ( interger array of numbers )

{



loop the array from the end

{

int max = 0;

int min = 0;



if ( element in array at current position is bigger than the one behind it ( 1 index below ) )

{

max = current element;

}

else

{

min = current element;

}

}



display the square root of min using the math class in C++

display the square root of max using the math class in C++

}



There I solved it for you big time. If I code it for you. You wont learn anything. You use and base it
anonymous
2011-08-14 21:46:45 UTC
Typically, the people who frequent this area of Yahoo! Answers won't do homework problems, aside from occasionally handing out a small snippet of code. Why not? Because you learn programming by doing it. It would take me less than 10 minutes to do this problem myself. I can do that because I worked hard to learn how to program and gain the skills that I have.



Make a decent attempt at writing the code yourself, and then come back if you have questions about what you have attempted. The problem is very basic, and we won't be doing you any favors by completing the assignment for you.
chunaram
2016-10-19 03:32:50 UTC
hi, that's merely as a wager in spite of the undeniable fact that it form of feels that this methodology is initiating in a DOS field, exiting in the present day and closing down the DOS field. you would be able to desire to place a pause in there whilst this methodology is done. the suited thank you to try this's by employing including in a decision to getch() earlier this methodology exits. getch() will study a single character in the present day from the keyboard, without echoing it to the reveal so its suited for including a pause on the tip of your application. as an occasion carry mutually and run here 2 classes. One is with getch() and the different without and notice the version. // application a million without getch() #comprise #comprise void important(void) { printf("nhello without getch()n"); // This line heavily isn't seen with the aid of fact the DOS field closes // in the present day } // application 2 With getch() #comprise #comprise void important(void) { printf("nhello with a getch()n"); // This line would be seen with the aid of fact the DOS field continues to be open till // the person presses a key // look ahead to person to press a key getch(); }


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...