Q&A Discussions
need help plz
0 Votes
2 AnswersWhy is this the output?
0 Votes
2 Answerstitle in html
1 Vote
1 AnswerI dont unserstand the output if this code :
# string formatting
nums = [4, 5, 6]
msg = "Numbers: {0} {0} {2}". format(nums[0], nums[1], nums[2])
print(msg)
4 4 6
but when I do :
# string formatting
nums = [4, 5, 6]
msg = "Numbers: {0} {0} {2}". format(nums[1], nums[1], nums[2])
print(msg)
it gives me
5 5 6
is there a priority in the Reading ?
0 Votes
5 AnswersWhat is the output?
0 Votes
1 AnswerFile Descriptors
0 Votes
1 AnswerYou 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 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 AnswersWhat is the output and why?
public static int[] make (int n){
int[]a=new int [n];
a [i]=i+1;
}
return a;
}
public static void dub (int []jub){
for (intent i=0;i <jub.length;i++){
jub*=2;
}
}
public static int mus (int []zoo){
int jus=0;
for (int i=0;i <zoo.length;i++){
jus+=zoo [i];
}
return jus;
}
public static void main (String [] args){
int [] bob =make(5);
dub (bob);
System.out.println (mus (bob));
}
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