answersLogoWhite

0

When writing a program that expects to retrieve data from a user, you have to first know what kind of interface to use. Decide whether you wish to write a console or windowed (graphical) application.

For console applications, you would likely use the scanf() function to retrieve values. See the help system for your compiler or look up "scanf" on the Web for details on using this function.

Graphical applications depend upon the operating system you're using. For instance, under Win32, you have the following options:

- Design a dialog at runtime consisting of STATIC and EDIT controls, plus a BUTTON control for the user to tell your program to commit the data, created with the CreateWindow() or CreateWindowEx() functions;

- If you're using an IDE (i.e. VC), it probably came with a resource editor you can use to create a dialog that contains labels and edit controls.

If you're brave enough to attempt some X11 coding, you'll need to decide which window manager you're using, and read up on the API for that WM to know which functions you have at your disposal.

You will also need to store this data in variables and then act on those variables as desired.

User Avatar

Wiki User

12y ago

What else can I help you with?

Continue Learning about Engineering

what is the answer on how to make a program that will ask the user to enter four number and display the sum and average of that four number?

To create a program that asks the user to enter four numbers and then displays the sum and average, you can follow these steps: First, prompt the user to input four numbers and store them in variables. Next, calculate the sum by adding these numbers together. Finally, compute the average by dividing the sum by four, and then display both the sum and the average to the user. Here's a simple example in Python: numbers = [float(input("Enter number {}: ".format(i+1))) for i in range(4)] total = sum(numbers) average = total / 4 print("Sum:", total, "Average:", average)


Write various ways to implement stack data structure?

2. Write a program using switch statement that reads a character representing a geometrical figure, then asks the user to enter the required data (ex. Radius for a circle, length and height for a rectangle, etc. ...) . The program should then print the area and circumference.Figures are: circle(c), square(s), rectangle(r), triangle (t).


How do you write a program that asks the user to enter their favouite tv programme and display the result 15 times?

#include <iostream> #include <string> using std::cin; using std::cout; using std::endl; using std::string; int main() { cout << "Enter name of your favorite TV show: \n"; string tvShow = ""; cin >> tvShow; for (int i = 0; i < 15; i++) { cout << endl << tvShow; } cout << endl << endl; system("PAUSE"); return 0; }


Write a program to find the average of three numbers?

#incude<iostream.h> #include<conio.h> void main() { clrscr(); int a,b,c,d,avg; cout<<"enter s numbers"; cin>>a>>b>>c>>d; d=a+b; avg=d\3; cout<<"the average is"<<s; getch(); }


Can a programmer change a code line and make it a new program?

Yes. I can write a python program that asks for your name and then prints "Hi, name, good to meet you." by writing the following program.#!/usr/bin/pythonname = input("What is your name? ")print("Hi", name + "," , "good to meet you.")If I change the third line toprint("Hi", name + ",", "good to meet you. Your name is", len(name), "letters long.")It will say "Hi name, good to meet you. Your name is xletters long.", thus making it a different program.

Related Questions

Write a program in php that asks the user to enter a distance in kilometers, then convert that distance to miles. The conversion formula is as follows: Miles = Kilometers x 0,6214?

answer:


How do I write an application that asks the user to enter two integers obtains them from the user and displays the larger number followed by the words is larger?

write an application that asks the user to enter two integers obtains them from the user in java


what is the answer on how to make a program that will ask the user to enter four number and display the sum and average of that four number?

To create a program that asks the user to enter four numbers and then displays the sum and average, you can follow these steps: First, prompt the user to input four numbers and store them in variables. Next, calculate the sum by adding these numbers together. Finally, compute the average by dividing the sum by four, and then display both the sum and the average to the user. Here's a simple example in Python: numbers = [float(input("Enter number {}: ".format(i+1))) for i in range(4)] total = sum(numbers) average = total / 4 print("Sum:", total, "Average:", average)


Write various ways to implement stack data structure?

2. Write a program using switch statement that reads a character representing a geometrical figure, then asks the user to enter the required data (ex. Radius for a circle, length and height for a rectangle, etc. ...) . The program should then print the area and circumference.Figures are: circle(c), square(s), rectangle(r), triangle (t).


How does one use a Repayment Mortgage Calculator?

One can use a repayment mortgage calculator online. All you have to do is insert the numbers it asks for and then hit enter to get the calculation on your mortgage.


How do you pass input to an interactive program through an external file in java?

hi i used ProcessBuilder to run the program but i m stuck with how to pass input to the executable. If i run that .exe file in cmd it asks to "enter your choice (1/2/3)" How to pass the choice from my java code?


What is 600k in a frame?

this is the question Emma asks to enter her page and the answer is..... cemetery gates


What will you do if someone asks please write anything here?

write the word "anything" to the spot indicated lol


Where do you write the code to get the gift on moshi monsters?

you write it when you login under your password where it asks for a secret code.


Where can you find a list of all William-Sonoma store locations in the US including telephone numbers?

See the related link to their web-site. At the bottom of the page - click the 'find a store' link - and enter the information it asks for !


How do you enter gift codes for Minecraft PC?

You will need to register first, when it asks how you want to pay it should have an option to enter a gift code.


What does it mean when someone asks you to edit your tags?

This is when a parent or guardian asks you to write your name in the label or "Tag" located inside your clothes.