Q&A Discussions
Java script rule of three!
0 Votes
1 Answerhow do I get line breaks?
name = input("What is your name?:")
print("Hiya, " + name)
age = int(input("Tell me your age:"))
year = str((2016 - age) + 100)
num = int(input("Enter a number between 1 and 50:"))
line = str((name + " will be 100 in the year " + year) * num)
print(\n line)
2 Votes
3 Answershello guys? how are you. i am zeeshan ali from pakistan. i have been in touch with this app for a very long long time. i have found so many friends awesome.. and we do combine study over the internet. anyone of you is interested then join us on facebook by searching this number 03033951255
0 Votes
4 Answersabout size/resize, and measurements: when assigning width or height, px is often! how many px's are there per inch or per cm? for width, it is convenient, with some other measurements applicable, but for height? px's is rather imperceptible! I tried to attribute a certain height in my code, what is best: px, rows, number of lines or what?
1 Vote
3 Answersa)Write a function ‘rev’ which returns the reverse of the given integer. Function isPalin takes an integer as argument and checks whether it is palindrome or not using rev function. Using isPalin write a main function to accept n integers and display number of palindrome numbers found.
b)write a program to find the possible permutations of the given word .
0 Votes
2 AnswersYou shall write a program that reads, from standard input, an arbitrary number of case-insensitive card descriptions, the totality of which shall be considered a hand. When standard input is exhausted, the program shall print one line to standard output describing the value of the hand. The program shall generate no other output.
0 Votes
3 AnswersI need to design a recursive function called replicate recur which will receive two arguments: times which is the number of times to repeat and data which is the number or string to be repeated.
The function should return an array containing repetitions of the data argument.
For instance, replicate_recur (3, 5) should return [5,5,5].
If the times argument is negative or zero, return an empty array. If the argument is invalid, raise ValueError.
0 Votes
4 AnswersWrite and test a program that solves quadratic equations. A
quadratic equation is an equation of the form ax2+ bx + c =0 ,where a,b and c are given coefficient and x is the unknown The coefficients are real number inputs ,so they should be declared of type float or double Since quadratic equations typically have two solutions ,use x1 and x2 for the solutions to be output These should be declared of type double to avoid inaccuracies from round-off error
-1 Vote
3 AnswersIn the short code below, I declared an array of five elements. But I'm getting confused on how to use it in a while loop. My main question is , if the user inputs a userchoice1 value that is less than 1, I want the code to keep looping until the user inputs a number that is not less than 1. But I don't know if the 7th line (userchoice1 [x]++) shows the right way to loop it.
1 Vote
2 AnswersI have 10 variables called, int1, int2, int 3 and so on. The user can write one number into the console. If the user types 7, I want to add 3 to the value of int7. how do I do this without 10 if statements? can I somehow do something like, (int + "userinput") += 3?
thank you for your help! :D
0 Votes
2 AnswersAssign each track runner a roster number and calculate the average age of the team.
As output the program should print the roster in three columns like in the following format:
Roster # Name Age
1 First Name 18
2 Second Name 19
3 Third Name 19
4 Fourth Name 20
5 Fifth Name 18
The average age of the team is 18.80.
-1 Vote
1 AnswerAssign each track runner a roster number and calculate the average age of the team.
As output the program should print the roster in three columns like in the following format:
Roster # Name Age
1 First Name 18
2 Second Name 19
3 Third Name 19
4 Fourth Name 20
5 Fifth Name 18
The average age of the team is 18.80.
0 Votes
1 Answer Write a C++ program that retrieves all the numbers stored in a data file named LAB1.TXT. As each number is retrieved, it is displayed on the screen. After the end of file is reached, the numbers should be sorted into numerical order and then the result should be displayed
EXAMPLE: Assuming LAB1.TXT has the following numbers: 7 4 12 3 The output would be Original order:7 4 12 3Numerical order:3 4 7 12
0 Votes
2 AnswersHot today
Javascript
3 Votes
Fitting
0 Votes
Why text takes time to load
1 Votes
Digital currency
1 Votes