user-input

Java Homework user input issue [closed]

丶灬走出姿态 提交于 2019-12-20 07:50:28
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . I have a class assignment to read in data using Scanner. import java.util.Scanner; public class Project23 { public static void main(String[] args) { // Declarations and instantiations. Scanner scan = new Scanner

How to pass arrays in the main func. w/ c++

蓝咒 提交于 2019-12-20 07:48:23
问题 #include <iostream> using namespace std; const int MAX = 1000; int ArrMix[MAX]; int *ptrArrPos[MAX]; int *ptrArrNeg[MAX]; int PosCounter = 0; int NegCounter = 0; int r; void accept(int ArrMix[MAX]) { cout<<"Enter the number of elements in your array: "; cin>>r; for (int i = 0; i < r; i++) { cout<<"Enter value:"; cin>>ArrMix[i]; } } void process(int &i) { if(ArrMix[i] >= 0) { ptrArrPos[PosCounter] = &ArrMix[i]; PosCounter++; } else { ptrArrNeg[NegCounter] = &ArrMix[i]; NegCounter++; } } void

Can't get raw_input to return a number

喜你入骨 提交于 2019-12-20 07:47:43
问题 print "How old are you?", age = raw_input() print "How tall are you in inches?", height = raw_input() print "How much do you weigh in pounds", weight = raw_input() print "So, you are %r years old, %r inches tall, and %d kilograms." % ( age, height, weight / 2.2) So I am new to code and this is my code. When I use terminal to compile it, I get this: How old are you? 1 How tall are you in inches? 1 How much do you weigh in pounds 1 Traceback (most recent call last): File "ex11.py", line 9, in

Creating a gui around a python script using Tkinter

心已入冬 提交于 2019-12-20 07:36:02
问题 I have an existing python script and I want to wrap it in a GUI. Since I already have tkinter installed I would like to use it if possible. At the moment my script has many places where it asks for user input using raw_input(). I would like to replace these with either a modal pop-up asking for user input or (preferably) an Entry object which responds to the enter key. 回答1: UI toolkits usually have an event-driven model where the main loop is in the toolkit itself. This is probably different

User Restrictions based on Field Content in MS Access

为君一笑 提交于 2019-12-20 07:18:59
问题 I need to set up user permissions within the same table, based on the value of a field. I know that this is not directly possible in Access but a post on Allenbrown.com points to a way of doing this see here. I'm not proficient in coding so I'm hoping that I can get some directions from you. Here are the details: I have two tables in the database, a parent one populated via a form and a children one populated via a subform. The parent contains companies and the child contain subsidiaries of

Allow Python App To Continue Running Until User Ends

纵饮孤独 提交于 2019-12-20 05:21:40
问题 I'm pretty new to python and I wrote a simple blackjack card counting app. The app runs and after the user input it ends, I want it to continue asking for the user input and printing the count out. I don't want it to restart, I want it to continue. Ive included the source code. Thanks guys. count = 0 var = int(raw_input("Enter the value of the card: ")) if var == 1 : print count + 1 elif var == 2 : print count + 1 elif var == 3 : print count + 1 elif var == 4 : print count + 1 elif var == 5 :

User Names and White-Spaces [closed]

不问归期 提交于 2019-12-19 18:30:11
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . In past many years I have registered on various applications and platforms hosted online or offline. Why white-spaces are not allowed in User Names as spaces are very natural to names and most of the computing

Regex: How to remove extra spaces between strings in Perl

北城以北 提交于 2019-12-19 18:25:35
问题 I am working on a program that take user input for two file names. Unfortunately, the program can easily break if the user does not follow the specified format of the input. I want to write code that improves its resiliency against these types of errors. You'll understand when you see my code: # Ask the user for the filename of the qseq file and barcode.txt file print "Please enter the name of the qseq file and the barcode file separated by a comma:"; # user should enter filenames like this:

Regex: How to remove extra spaces between strings in Perl

↘锁芯ラ 提交于 2019-12-19 18:25:25
问题 I am working on a program that take user input for two file names. Unfortunately, the program can easily break if the user does not follow the specified format of the input. I want to write code that improves its resiliency against these types of errors. You'll understand when you see my code: # Ask the user for the filename of the qseq file and barcode.txt file print "Please enter the name of the qseq file and the barcode file separated by a comma:"; # user should enter filenames like this:

User input without pausing code (c++ console application)

隐身守侯 提交于 2019-12-19 12:02:00
问题 How can I enter an input without causing the code to stop executing? I have been searching for an answer during the last 20 minutes without result. cin >> string; pauses the code AFAIK. Would I need to use mulithreading, or is there a better way? (I don't even know if multithreading would work.) I've recently started learning c++, I am a beginner to say the least, so please explain thoroughly and include any library I might need, thank you. 回答1: There are two algorithms for getting input