Using the pseudo-code and the top-down modular approach
Develop a menu-driven program that inputs a number X, and at the user's option, finds and displays the area (A) of one of the following:
A square with side X, A = X^2
4 replies to this topic
#1
Posted 11 January 2011 - 06:34 AM
|
|
|
#2
Posted 11 January 2011 - 07:58 AM
What exactly do you not understand?
Sometimes words ain't enough to express something. That's why computer scientists use double words.
#3
Posted 11 January 2011 - 04:23 PM
I was trying to use the proper code to make this question work, and have the computer give the user correct answer, here's the direction I took. maybe i should use VB or C++ to get the proper results.
A =5 , X=5^2
Main
Declare A, X as integer
Set A = sqrt
Set power= x, n
Write “Find the area of A”
End program
Function square as float
Function power as float
If x ==25, then
Write “ the total of A is”
Set total = (A) * 2
End if
End function
Total = 25
A =5 , X=5^2
Main
Declare A, X as integer
Set A = sqrt
Set power= x, n
Write “Find the area of A”
End program
Function square as float
Function power as float
If x ==25, then
Write “ the total of A is”
Set total = (A) * 2
End if
End function
Total = 25
#4
Posted 12 January 2011 - 06:38 AM
Okay, I thought your problem wouldn't be that straightforward.
Here's a C++-example:
It might be that you have to use using namespace std.
Greets,
artificial
Here's a C++-example:
#include <iostream.h>
int main(int argc, char* argv[])
{
int x = 0;
cout << "Please enter the edge length...\n"
cin >> x;
x *= x;
cout << "Area is " << x << "!\n";
return 0;
}
It might be that you have to use using namespace std.
Greets,
artificial
Sometimes words ain't enough to express something. That's why computer scientists use double words.
#5
Posted 15 January 2011 - 08:19 PM
Thanks I'm try this example.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account


Back to top









