Questions tagged [user-input]
User Input is data that the user inputs into the program. It generally takes the form of a String, but may also be an integer, floating-point number, etc.
5,510
questions
1
vote
1
answer
34
views
How do I change the input background color and text color when a specific value is saved?
This is my first time using the Stack overflow website, so apologies if anything is unclear or missing. If you'd like to see a particular part of my code, let me know.
I wrote my PHP code (as good as ...
1
vote
2
answers
52
views
C Programming Input Validation for checking if entire string is alphabet [closed]
I have working code when i just test char[] = "Gabriella". However, I need to get user input. Getting the input from the user breaks my code and I do not understand why.
#include <stdio.h&...
0
votes
0
answers
43
views
best way to store and retrieve multiple details using dictionary in python?
Objective: I have user inputs for the following:
a. book name
b. number of pages
c. publisher
d. Genre
I need to store and retrieve the details to display, like a menu system.
For now, I used a class ...
0
votes
1
answer
29
views
Why does a previous name I inputed repeat itself each time I input a new name on a form and click on add?
JavaScript: My form input value keeps repeating itself. Each time I enter a new name in the input field and click on the add button, the previous name I entered repeats itself and the new name is also ...
1
vote
1
answer
44
views
How to get user input in the J programming language
I'm very new to the J programming language, so I got interested in array programming languages and decided to give it a go.
Unfortunately, It's a very niche language, meaning that there aren't many ...
-1
votes
0
answers
22
views
I need to get data from user message [closed]
def start(update,context):
print(1)
keyboard = [[InlineKeyboardButton('Алгебра',callback_data = '1'), InlineKeyboardButton('Геометрия',callback_data = '2')],
[...
0
votes
1
answer
21
views
I need input from my main module into another module created after
Java "Fat Gram Calculator" programming I'm attempting needs to validate input, I get to a point where I need to validate the input from user, taking into consideration a previous input from ...
-1
votes
3
answers
45
views
C# Array not utilizing inputs
I am new to programming and am taking a class. Our assignment is to allow specific integer inputs and then return said integer inputs in numerical order. I have everything working all the way up to ...
-1
votes
1
answer
47
views
How do i set null in entry box while taking integer input for calculation
How do i set null in entry box while taking integer input for calculation
I am confused because I want int else in case of string I know what to do can anyone help me i will be grateful for that
-3
votes
1
answer
45
views
unable to get an input of a string [closed]
I am trying to make a program to try out all the functions of a C-string.
I have taken two inputs, the 1st input is taken, but the 2nd input is not taking. How can I correct my program?
#include<...
0
votes
1
answer
17
views
Resize grabber on HTML input form not working on phone browsers
I'm using the textarea html tag on a website to create a text input box.
<textarea name="message" placeholder="Hello..." required class="input1 input1B" id="...
0
votes
0
answers
15
views
a non-linear polynomial equation as a user defined input in python
I have a non-linear polynomial equation example: 2*x**2 - sin(x) + 1. how will I code to take this equation as a user input
i tried using eval() function but how will i describe the x
s= input("...
0
votes
1
answer
32
views
Python - Having trouble with arranging a parallel list within a for loop based on user input
Slow beginner here. Trying to write a program that asks the user how many entries to make. From that number, it will then ask the user for their name and address to print in a parallel list. So far ...
0
votes
1
answer
38
views
storing input in array, using sentinel value to exit loop, displays some stats Python
I am having to press 0 twice before exiting the loop and I need to print mean salary and all salaries within 5k of mean. HELP A NOVICE?!
#This program takes an employee name followed by their salary ...
0
votes
0
answers
11
views
Get the value of rows and column inputs fields of dynamically created table in REACT.js
I am trying to get the values of inputs field of rows and columns of my dynamically created table, but I saw noting on console.
Here is my code .
import React, { createElement, useState } from 'react'
...
0
votes
1
answer
19
views
Unable to input two different series of numbers into two different vectors
New learner working through a coding book and having trouble with an exercise problem. The exercise goal was practicing using the for() loop.
I'm trying to read two lines from a .txt file into two ...
-3
votes
0
answers
36
views
Can someone help me with this Java problem? [duplicate]
I was assisgned a bonus problem in class and I don't know much on how to go about resolving it.
Create a vertical line of characters as the program runs.
By default the program will create a series of ...
0
votes
0
answers
25
views
storing user input into array, using sentinel value in Python
I am having trouble getting my sentinel value to work properly. When the user presses 0 to exit, I want the program to display the names and salaries of all the employees, the average of all the ...
0
votes
2
answers
50
views
Needing to have user input for some paths and use relative paths for compressing my folder
I am creating an automation script that should take a user's input for version, package new, and new package path, then compress it into a zip folder. Unfortunately, I can't hardcode the paths, so I'm ...
0
votes
0
answers
32
views
Is there a way prompt user for input and continue after set number of characters, so as to avoid waiting for the enter key in python 3?
I am trying to write a python typing test that displays 5 letter words from a list in a timed while loop of 60 seconds. Everything works if the user presses enter after each typed word but this ...
0
votes
1
answer
17
views
Getting TypeError: 'JpegImageFile' object is not callable while asking for user input
I'm trying to convert an image by removing background and then asking user if they want to resize before saving.
When trying to read user input before saving the file, i get an error: TypeError: '...
1
vote
1
answer
37
views
User input stored into array and prints categorized results in PYTHON
I have to write a program where a user inputs the name and number of new memberships. This info is stored in an array. Specifically, the user enters a trainer's last name and the number of new ...
0
votes
0
answers
29
views
How can I get Console.Write() to print multiple string variables? [duplicate]
I'm having a hard time getting my console.write() function to print multiple strings on the console. It only prints the first one. Am I missing some sort of syntax ? `
//Prompts the user for the first ...
-1
votes
1
answer
29
views
User Input going through list of Dictionaries
I am trying to have the output to return the previous list instead of the same list. I created two lists, one for the new entry for every search and one to save the search to be used if the User input ...
0
votes
1
answer
39
views
Using 'for' loop and 'if' statements getting double prints on values over 10 [duplicate]
So I have this loop figured out but with values over 10, the program double prints how much the ticket cost. What is wrong with my code?
age = input("Enter your age to get ticket prices: ")
...
0
votes
0
answers
13
views
detecting a user based event and update based event in shiny
I need to find a way to update a UI object both by the user and as a byproduct of other backend calculations.
The reactivity however should be different. I require a method to know who was the agent ...
0
votes
2
answers
24
views
How to read a numeric expression from user in R studio
I want to read a numeric expression (ex:- 9/3) from the user during runtime and print the answer(3). I used readline() but since it reads the line as a string, when as.numeric() function is applied ...
0
votes
2
answers
25
views
I'm trying to add words to an array from a text input but it is coming back as an "Uncaught TypeError"
This is the error message - "<a class='gotoLine' href='#76:28'>76:28</a> Uncaught TypeError: document.getElementId is not a function"
I have two text inputs being combined ...
-2
votes
0
answers
26
views
Are you able to use a boolean in a keyPressed Event to trigger a break from a while loop?
Is this not the right way to try to solve this problem?
public class GUI {
JFrame mainFrame;
PrintStream standardOut = System.out;
PrintStream standardErr = System.err;
JTextField ...
0
votes
2
answers
62
views
How can I make a click-through overlay in Rust that still captures input?
I already have code that creates a transparent window and draws a square on it using winit and pixels, but I can't make it click-through, that is, let the user interact with what is behind the overlay ...
0
votes
1
answer
25
views
How to apply input to the set method, and in another case, input outside main?
me again. This time I need to get user input, plug them into various set methods, and output a value. It sounds pretty easy although the assignment instructions make it seem way harder.
In depth:
I ...
0
votes
0
answers
24
views
How to get user input in Node.js with callback functions?
const readline = require('readline').createInterface({
input: process.stdin,
output: process.stdout
});
let greetings = (name) => {
window.alert(`hello ${name}`);
}
let ...
0
votes
1
answer
49
views
How does the user's input affect the file and text?
In one python file here is the code(It needs to have at least 1 Capital letter and more than 8 letters. If it doesn't then it should ask for the variable password(not username because it doesnt need ...
-1
votes
0
answers
28
views
Python code causing error even though I'm just copying and pasting an existing program
I am currently learning Python, and going through some written program examples to better understand how they work. I am inputting this written program:
In [ ]: age = input('What is your age? ')
...
-4
votes
1
answer
32
views
How to compare information from a file in python
So I have a file and I want to compare it with my user's input so that the file's information may equal what the user has inputted. In the reg_login.txt it holds information.
Username = Emmanuel, ...
0
votes
1
answer
19
views
How does the User's input meet the requirements chosen?
So, I want the code to see the user's input and meet the requirements of my choice. Let's say I want the user to input a password, but it must be 8 letters long or higher and have one letter in ...
0
votes
1
answer
28
views
Why is my array only accepting the last number taken as the first element, and putting 0 as the rest of the elements?
The validation works as far as i had tested (that being all possible cases that could trigger the various parse checks), what I`m struggling with is inputing user input after its been validated to not ...
-1
votes
3
answers
41
views
Limit user input in python in special format
Hi I would like to request a time from the user in the format "HH:MM" using the input() function.
Do you have an idea with which function I can ensure that the user only enters numbers and ...
0
votes
2
answers
37
views
How to sort a matrix in a row-wise manner in java
I've been trying to sort the elements of my matrix in a row-wise manner. But when I try to sort them out I end up with the error error: incompatible types: int cannot be converted to int[][]. And for ...
0
votes
1
answer
30
views
How do you accept input without using scanf (using input from compile command in terminal)?
I'm a beginner to C and I'm trying to accept input from zsh terminal using
./filename 1234 5678
So, instead of using scanf where you compile and run then get prompt to input numbers, I want to write ...
1
vote
1
answer
47
views
Reading input till end of line in java
I have a switch statement that asks the user to input some data.
For case 2: the user is supposed to enter data like below.
1081 678 873 1438 1276 1243 428
The programme will read every nextInt and ...
0
votes
0
answers
22
views
Client-Server-Architecture: Move computation logic from client to backend - Algorithm needs certain new values while running (User input) and continue
Background:
At work I was tasked with developing a new demo web client to replace our Windows Form application in the future. Our back-end is developed in Java and works stateless as REST services. ...
0
votes
2
answers
61
views
Why isn't my array getting fully populated?
I have created a method in which I create an empty array that can hold 6 integers. Then I run a for-loop which will ask the user for an integer, verify it as a positive integer and then send that ...
0
votes
0
answers
27
views
Code doesn't go through when inputting a number when prompted [duplicate]
I'm a beginner to Java, the code is for a homework assignment regarding files and loops.
When I to run this code to check for any errors, when hitting a number, it doesn't go forward past the menu. ...
-2
votes
1
answer
29
views
Simple code to get inputs from user and then print them all at once not working? [duplicate]
I'm new to python and was doing a few "simple python tasks" to get started. I wrote a code to get a few numbers from the user and then after the user gives all numbers it prints them all.
...
-1
votes
1
answer
22
views
How to validate input type(java) [duplicate]
I have the following snippet of code and I don't know how to make sure that the user is entering a positive int. What can I do so that the code makes sure the input type is valid.
public static void ...
0
votes
0
answers
28
views
trouble with graph edge representation
I'm pursuing an algorithms course and currently we're learning network flow algorithms and hence naturally, we'll be dealing with graphs.
The issue I'm facing is with an assignment question that we've ...
0
votes
0
answers
11
views
Create a Python Program to get User Input
I am to write a python code to the following:
Ask the user to enter the first name and store it in the first_name variable.
Ask the user to enter the second name and store it in the last_name variable....
0
votes
0
answers
20
views
Mimic user input (press enter) to escape from the block of input() in multithread scanrio
I have a thread keeps asking user's input, how can I escape the block of input() in the main thread?
from threading import Thread
import time
flag = True
def keep_ask_input():
print('thread ...
4
votes
1
answer
56
views
How to give 'infinity' as a value to double through cin in C++?
In my program, I'm taking a slope value as input from the user. The code snippet looks like this:
double m;
std::cout << "Enter slope value:";
std::cin >> m;
But currently I'm ...