In BASIC, this could be as simple as:
10 Input X
20 Input Y
30 Z=X+Y
40 Print X;" + ";Y;" = ";Z
50 END
In JAVA...
/**
* A simple calculator that adds, subtracts, multiplies, and divides.
* Written in Java by: AustinDoggie
*/
public class Calculator()
{
public Calculator()
{
// don't really have to do anything here
}
public int add(int x, int y)
{
int z = x + y; // add two numbers
return z; // and return it
}
public int subtract(int x, int y)
{
int z = x - y; // subtract two number
return z; // and return it
}
public int multiply(int x, int y)
{
int z = x*y; // multiply two number
return z; // and return it
}
public int divide(int x, int y)
{
int z = x/y; // divide two numbers
return z; // and return the result
}
}
Hope that helps.
you cant
Any type will do, here is an example: for (leave= 0, nnum= 0; ! leave; ) { rc= scanf ("%d", &number); if (rc!=1 number==-1) { leave=1; continue; } ++nnum; ... do something with number ... }
The simplest way is to add a loop around the ask-for-the-number, show-the-table routine. In pseudocode:while (1) { ask-for-the-number; show-the-table; }
Algorithms do not accept user input; they are not computer programs. All input to an algorithm is specified at the start of the algorithm along with any required preconditions and postconditions. If a required precondition is not specified or is specified incorrectly, then this could result in unexpected results (or undefined behaviour in programming terminology). The type of error in the algorithm is simply that the precondition was not specified.
More info;You will write a program that will interact with the user by name and allow for the recording of grades for three classes: Tech, History, and Math. The program will allow the user to determine how many assignments to enter in each class, the name of each assignment, the total value of each assignment, and the users score on each assignment. The program will will write the scores to a file and have the ability to:Tell the user the high and low score in each class along with the assignment nameRepeat entries back to user by assignment name and score to ensure accuracyTell the user their current grade in each classTell the user their current gpa based on the overall percentage of each class
Write a program which takes any number of days from the user. the program should display the number of years, number of months formed by these days as well as the remaining days.
user-generated content: disclaimer report abuse = Write a program which will rise any number X to a positive power nobtain values of X and n from user? =
write a program to display your name age class schoolname e-mail 2hobby based on choice
Write a program which displays digital watch on the screen, after taking the hours and minutes from the user.
programming language paradigm
you cant
CIT 120 - Computational Thinking In QBasic, create a guessing game. You should have your program to generate a random number from 1-100 (inclusive). Let the user guess a number from 1-100. The program should let the user guess until they get the correct number. After each input, the program should tell the user whether they guessed the correct number, or if they should guess higher or guess lower. While the user is entering guesses, the program should keep a count of the number of guesses that it takes to get the correct number. After the user guesses the correct number, the program should congratulate the user and tell them how many guesses it took them to get the correct number.
No, as long as it calculates something, displays something, or otherwise has an output that benefits the user, it is a program. It could be a program that makes a random number, or a program that tells the user a joke from a database.
data file
To get all tutorials of "c programming" Reference:cprogramming-bd.com/c_page2.aspx# prime number
Software with a multi-user license may be installed on a LAN, but only the number of users specified in the EULA may have accsess to it.software with a multi-user license may be installed on a lan, but only the number of users specified in the EULA may have acces to it
It logs off the user after detecting no activity for a specified number of minutes. Example: If a user steps away from his or her desk w/o first logging off, info in the Medisoft program can be viewed by anyone who uses the computer.