Quiz 6_ Representation_ CMPT130 D100 Introduction to Computer Programming I
.pdf
keyboard_arrow_up
School
Douglas College *
*We aren’t endorsed by this school
Course
130
Subject
Computer Science
Date
Dec 6, 2023
Type
Pages
8
Uploaded by LieutenantSparrow1721
12/7/21, 3:12 PM
Quiz 6: Representation: CMPT130 D100 Introduction to Computer Programming I
https://canvas.sfu.ca/courses/64792/quizzes/178192
1/8
Quiz 6: Representation
Due
Oct 30 at 11:59am
Points
12
Questions
12
Available
Oct 29 at 11:30am - Oct 30 at 11:59am 1 day
Time Limit
30 Minutes
This quiz was locked Oct 30 at 11:59am.
Attempt History
Attempt
Time
Score
LATEST
Attempt 1 27 minutes
6 out of 12
Score for this quiz: 6
out of 12
Submitted Oct 29 at 10:36pm
This attempt took 27 minutes.
0 / 1 pts
Question 1
Which type can store all the values between 1.01 and 1.02?
1. float
2. double
3. long double
2 and 3 You Answered
You Answered
none of them orrect Answer
orrect Answer
3 1 2 all of them
12/7/21, 3:12 PM
Quiz 6: Representation: CMPT130 D100 Introduction to Computer Programming I
https://canvas.sfu.ca/courses/64792/quizzes/178192
2/8
0 / 1 pts
Question 2
Which type can store a reasonable approximation of 20! (20 factorial)?
1. int
2. float
3. double
2 and 3 orrect Answer
orrect Answer
all of them 2 none of them 1 You Answered
You Answered
3 1 / 1 pts
Question 3
What data type should the result
variable be declared as to best hold the
result of the following C++ statement?
result = "5.1" + "10,1";
string Correct!
Correct!
int any of these types char
12/7/21, 3:12 PM
Quiz 6: Representation: CMPT130 D100 Introduction to Computer Programming I
https://canvas.sfu.ca/courses/64792/quizzes/178192
3/8
double Note that the two operands to + are strings.
0 / 1 pts
Question 4
What might be represented by the bit pattern shown below?
0000 0010 1101 1101 0010 1111 0011 1011
1. An integer
2. A floating point number
3. The colour of a pixel
2 all of them orrect Answer
orrect Answer
1 and 2 none of them 1 and 3 2 and 3 3 1 You Answered
You Answered
1 / 1 pts
Question 5
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
Related Questions
TASK 3
The Persian mathematician Al-Karaji (953-1029) computed the first description of Pascal's triangle given below.
It was later repeated by the Persian poet-astronomer-mathematician Omar Khayyám (1048-1131); thus the
triangle is also referred to as the Khayyam triangle in Iran.
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
15 10 10 5 1
1 6 15 20 15 6 1
1 7 21 35 35 21 7 1
The Pascal's triangle determines the coefficients which arise in binomial expressions. For example, consider the
expansion
(x + y)? = x² + 2xy + y = 1x³y® + 2x'y' + 1x®y?.
The coefficients of the terms are in the third row of the triangle. As a general approach, In general, when x + y is
raised to a positive integer power we have:
(x + y)" = aox" + ax-ly + azx"-?y² + ... + an-1xy-1 + any",
where the coefficients a; in this expansion are precisely the numbers on row (n+1) of Pascal's triangle. Each row
of the triangle can be computed by adding the pairs of numbers in the previous row from left to right. Write,
Compile and Execute…
arrow_forward
A university computer science department has a teaching assistant (TA) who helps undergraduate students with their programming assignments. The TA’s office is rather small and has room for only one desk with a chair and computer. There are three chairs in the hallway outside the office where students can sit and wait if the TA is currently helping another student. When there are no students who need help, the TA sits at the desk and takes a nap. If a student arrives and finds the TA sleeping, the student must awaken the TA to ask for help. If a student arrives and finds the TA currently helping another student, the student sits on one of the chairs in the hallway and waits. If no chairs are available, the student will come back at a later time. Using threads, implement a solution that coordinates the activities of the TA and the students.
Details for this assignment are provided below.
The Students and the TA Using threads (Section 4.4), begin by creating n students. Each will run as…
arrow_forward
A university computer science department has a teaching assistant (TA) who helps undergraduate students with their programming assignments. The TA’s office is rather small and has room for only one desk with a chair and computer. There are three chairs in the hallway outside the office where students can sit and wait if the TA is currently helping another student. When there are no students who need help, the TA sits at the desk and takes a nap. If a student arrives and finds the TA sleeping, the student must awaken the TA to ask for help. If a student arrives and finds the TA currently helping another student, the student sits on one of the chairs in the hallway and waits. If no chairs are available, the student will come back at a later time. Using threads, implement a solution that coordinates the activities of the TA and the students.
Can you please write the code for above solution in java
arrow_forward
A university computer science department has a teaching assistant (TA) who helps undergraduate students with their programming assignments. The TA’s office is rather small and has room for only one desk with a chair and computer. There are three chairs in the hallway outside the office where students can sit and wait if the TA is currently helping another student. When there are no students who need help, the TA sits at the desk and takes a nap. If a student arrives and finds the TA sleeping, the student must awaken the TA to ask for help. If a student arrives and finds the TA currently helping another student, the student sits on one of the chairs in the hallway and waits. If no chairs are available, the student will come back at a later time. Using threads, implement a solution that coordinates the activities of the TA and the students.
Can you please write the code for above solution in python
arrow_forward
A university computer science department has a teaching assistant (TA) who helps undergraduate students with their programming assignments. The TA’s office is rather small and has room for only one desk with a chair and computer. There are three chairs in the hallway outside the office where students can sit and wait if the TA is currently helping another student. When there are no students who need help, the TA sits at the desk and takes a nap. If a student arrives and finds the TA sleeping, the student must awaken the TA to ask for help. If a student arrives and finds the TA currently helping another student, the student sits on one of the chairs in the hallway and waits. If no chairs are available, the student will come back at a later time. Using threads, implement a solution that coordinates the activities of the TA and the students.
Details for this assignment are provided below.
The Students and the TA Using threads (Section 4.4), begin by creating n students. Each will run as…
arrow_forward
What year did John von Neumann get his PhD from the University of Göttingen?|
arrow_forward
The Famous Gauss
You must know about Gauss, the famous mathematician. Back in late 1700’s, he was at elementary school. Gauss was asked to find the sum of the numbers from 1 to 100. The question was assigned as “busy work” by the teacher. He amazed his teacher with how quickly he found the sum of the integers from 1 to 100 to be 5050. Gauss recognized he had fifty pairs of numbers when he added the first and last number in the series, the second and second-last number in the series, and so on. For example:(1 + 100), (2 + 99), (3 + 98), ..., (50 + 51). Each pair has a sum of 101 and there are 50 pairs. History repeats itself. Jojo’s teacher assign a “busy work” to the students. The teacher believes that there will be no shortcut to finish this task in a minute. The teacher gives N integers A1, A2, ..., AN to the students. The teacher also gives Q questions. Each question contains two integers L and R asking the sum of all Ai where L <= Ai <= R. As a good friend of Jojo, help Jojo…
arrow_forward
Overflows
You have learned the concept of overflow (with say n! that overflows at 13! for integer)
Now consider Fibonacci numbers this way: 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, etc.
A Fibonacci sequence f(n) is of the form: f(1) = f(2) = 1, and f(n+2) = f(n) + f(n+1) for n >= 1.
3. Write a Java computer program that prints out Fibonacci numbers in a certain data type from f(1)
until f(n) with n an integer you input from the keyboard.|
For short data type (signed of two bytes), the output looks like this way:
Enter 1 to 6 for char, short, int, long, float, and double
2
Enter a number to find the Fibonacci series: 50
The Fibonacci series till 50 terms:
Short Fibonnaci(1)= 1
Short Fibonnaci (2)= 1
Short Fibonnaci(36)= -11856
Short Fibonnaci(37)= -24967
Short Fibonnaci(38)= 28713
Short Fibonnaci(39)= 3746
Short Fibonnaci(40)= 32459
For int data type
Enter 1 to 6 for char, short, int, long, float, and double
Enter a number to find the Fibonacci series: 100
The Fibonacci series till…
arrow_forward
putty program for unix
arrow_forward
OM 455
Section 001
Course Grading Scale Based on Course Average:
Lower
Upper
Course
Limit
Limit
Grade
0
59
F
60
69
D
70
79
C
80
89
B
90
100
A
Midterm
Final
Course
Last Name
Score
Score
Average
Alt
69
51
60.0
Amini
90
89
89.5
Amoako
82
78
80.0
Apland
43
77
60.0
Bachman
66
44
55.0
Corder
88
96
92.0
Desi
82
74
78.0
Dransman
58
76
67.0
Duffuor
75
89
82.0
Finkel
95
98
96.5
Foster
90
88
89.0
Fuss
74
77
75.5
George
67
90
78.5
Gerson
79
72
75.5
Girling
58
66
62.0
Greer
92
96
94.0
Guerro
67
77
72.0
Hager
64
90
77.0
Heilman
79
85
82.0
Hibbard
94
94
94.0
Hills
62
52
57.0
Hughes
76
92
84.0
Hutchison
83
93
88.0
Jackson
81
95
88.0
Kassner
85
90
87.5
Kelcik
69
84
76.5
Kern
41
75
58.0
Kinner
51
86
68.5
Lair
86
96
91.0
Marsh
88
94
91.0
Martini
65
85
75.0
Mattlin
76
82
79.0
McGough
73
74
73.5
Miller
61
80
70.5
Minnick
58
88
73.0
Minster
66
64
65.0
Mueller
68
91
79.5…
arrow_forward
Birim darbe cevabı h(n) = {1, 2 ,1,-1} olan doğrusal zamanla değişmez bir sisteme uygulanan giriş
işareti x(n) =
, 2,3,1} ise
210007 61s210
n=0
n=0
A
21000 1693619210 10121000
B
u101210007 - 1693619210101210007 - 1693619210
007 - 1600619210
u101210007 - 1693619210101210007 - 1693619210
8
u101210007 - 1693619210
2619210
u101210007 - 1693619210101210007 - 169361s210
J7-1693619210
u101210007 - 1693619210
619210
u101210007 - 1693619210101210007 - 1693619210
u10121
u101210007 - 1693619210
619210
u101210007 - 1693619210101210007 - 1693619210
u101210007 - 1693619210
19210
u101210007 - 169361921010121
u101210007 - 1693619210
19210
u10121
u101210007 - 1693619210
$19210
u10121
19210
arrow_forward
O RottenAnchoredDecagons x
M (no subject) - jcofield122e x
O Lab 6: Module 6 - Repetitis x
https://tcc.instructure.com/courses/42392/assignments/976548?module_item_id32464159
-Write a program with af
as Program for Fibonacci nu x i1390rmc01171ipg (1920 x0 1390
Write a program with a for loop that displays the numbers 1 to 10 and their respective cubes. You may want to use the range function. Your output should look like the example
Number
Cube
******
1
8
27
4
64
125
5.
216
343
512
8.
729
9.
1000
10
To format your table you can use the tab syntax, \t, to tab your output. For example:
print("Number\t Square")
arrow_forward
WAP in Python for Disarium Number?
arrow_forward
Several retailers have gotten together and begun issuing a “state” credit card that is good only in stores in their state. As a courtesy, salesclerks are permitted to transcribe the 15-digit account number by hand (after getting it from the accounting office) if the customer is not carrying the card. The only problem with accounts that retailers have noticed so far is that sometimes-erroneous account numbers are accepted into the computer system, resulting in a bill being issued to a non-existent account.
1. What sort of validity test would clear up the problem? How? Respond in a paragraph.
2. Suggest an alternative data entry method that might alleviate this problem altogether.
arrow_forward
In C programming
Every budding computer scientist must grapple with certain classic problems, and the Towers of Hanoi (see Figure below) is one of the most famous of these. Legend has it that in a temple in the Far East, priests are attempting to move a stack of disks fromone peg to another. The initial stack had 64 disks threaded onto one peg and arranged from bottom to top by decreasing size. The priests are attempting to move the stack from this peg to a second peg under the constraints that exactly one disk is moved ata time, and at no time may a larger disk be placed above a smaller disk. A third peg is available for temporarily holding the disks. Supposedly the world will end when the priests complete their task, so there is little incentive for us to facilitate their efforts.Let’sassume that the priests are attempting to move the disks from peg 1 to peg 3. We wish to develop an algorithm that will print the precise sequence of disk-to-disk peg transfers. If we were to approach…
arrow_forward
QUESTION 5
The Towers of Hanoi game starts with a pile of disks with different sizes on one of three pegs. The other two pegs start empty. The disks are initially piled in order of size
with largest on the bottom. The aim of the game is to transfer all of the disks to a destination peg by moving one disk at a time, never placing a disk on top of a smaller
one. The spare peg may be used for intermediate moves.
One solution to the problem recursively moves all but the largest disk to the spare peg, moves the largest disk to the destination peg, and then recursively moves all the
other disks from the spare peg to the destination peg. This process is described by the following pseudocode:
Hanoi( n, start, destination, spare )
// n is the number of disks and start, destination and spare are peg numbers
if n>0
Hanoi( n-1, start, spare, destination)
moveTopDisk( start, destination) // move top disk on start peg to destination peg
Hanoi( n-1, spare, destination, start)
Which of the following…
arrow_forward
. According to legend, the first century Jewish historian, Flavius Josephus,was captured along with a band of 40 compatriots by Roman soldiers duringthe Jewish–Roman war. The captured soldiers decided that they preferredsuicide to being captured and devised a plan for their demise. They wereto form a circle and kill every third soldier until they were all dead. Josephand one other decided they wanted no part of this and quickly calculatedwhere they needed to place themselves in the circle so that they would bothsurvive. Write a program that allows you to place n people in a circle andspecify that every m person will be killed. The program should determinethe number of the last person left in the circle. Use a circularly linked listto solve the problem
arrow_forward
a manuscript page generally has about 500 words on it. if you read a manuscript in 1 minute and 24 seconds, what is your reading rate in words per minute? what is the number of pages you read per hour?
arrow_forward
Background
Once upon a time, in a certain medieval village, a group of mysterious strangers appeared in jeans and T-shirts. The strangers managed to learn enough Old English to explain that they had been enjoying their favourite pastime – belting out tunes at a karaoke party – when they saw a blinding flash and heard a thunderous roar, lost consciousness, and found themselves transported back in time without any explanation.
The villagers were most interested in the strangers’ wide-ranging knowledge of popular songs from the future. They understood that the strangers belonged to some sort of bard class. The villagers were also party animals, and had a feast every night. The bards agreed to come to some of the parties and sing one Billboard Top 40 song whenever they did. When they weren’t there, the villagers would sing these songs to each other, reverently, knowing that they held clues to the future of their world. The more they learned, the more they were able to share, and some were…
arrow_forward
Is it true that the majority of Earth's climate is governed by solar and lunar radiation?
arrow_forward
The game of chess was invented a few hundred years ago in India. The story has it, that the ruler of the area was so enchanted with the game, that he called the inventor to his palace, and asked him to name a gift.
The seemingly humble man asked the ruler to put a grain of rice on the first square of the chessboard, two grains of rice on the second and so on, doubling the grains each time until all 64 squares of the chessboard were filled.
The ruler was thinking about a full sack of rice and happily agreed. I didn't count it myself, but there are 32,000,000 grains of rice in a short ton (2,000 lbs). So do the calculation in Python and make a modern day comparison. Assume that a 50 foot rail car can carry 50 tons of rice.
Write a program that would calculate how long the train would have be to carry the inventor's request?
First Calculation: How many grain of rice?
Second Calculation: How many tons of rice?
Third Calculation: How many train car will be needed?
BONUS(3pts) If your…
arrow_forward
An early attempt to force users to use less predictable passwords involved computer supplied passwords. The passwords were eight characters long and were taken from the character set consisting of lowercase letters and digits. They were generated by a pseudo-random number generator with 2^15 possible starting values. Using the technology of the time, the time required to search through all character strings of length 8 from a 36-character alphabet was 112 years. Unfortunately, this is not a true reflection of the actual security of the system. Explain the problem
arrow_forward
X
\CD
0
For the given truth table's results column X, please fill the Karnaugh Map, indicating which M
locations you're using.
ABCD
0 0 0
00
00
01
11
10
AB
0
0
0
1
00
m0
m1
m3
m2
0
0
1
0
0
0 1
1
01
m4
m5
m7
m6
0
1
0 0
11
m12 m13
m15
m14
0 1
0
1
1
0
1
1
0
10
m8
m9
m11
m10
0
1
1
1
1
1
0
0
0
1
0 0
1
1
0 1
0
1
1
0 1
1
1
1
0 0
1
101
1
1
1
1
0
1
1
1
1
1
arrow_forward
Student information is being held in a data area, where each
student record has the following format:
The first nine bytes are the student number, held in ASCII
The next byte is the course mark
The next word is the section identifier
There are well over three hundred such student records that
have been loaded sequentially into memory starting at address
$10000. The last record loaded is a dummy record with a
section identifier of $FFFF, to show the end of the records.
If a2 has the address of a student record, if using indexed
addressing mode, what is the index value X such that X(a2)
addresses the course mark?
arrow_forward
Student information is being held in a data area, where each
student record has the following format:
The first nine bytes are the student number, held in ASCII
The next byte is the course mark
The next word is the section identifier
There are well over three hundred such student records that
have been loaded sequentially into memory starting at address
$10000. The last record loaded is a dummy record with a
section identifier of $FFFF, to show the end of the records.
If a2 has the address of a student record, what is the location
of the next record in the array / data area:
arrow_forward
Q3: Draw the state space
1
3
82 4
76 5
1 2 3
84
6 5
7
arrow_forward
Please solve as a C programming
arrow_forward
Story:
Once upon a time a farmer went to a
market and purchased a wolf, a goat,
and a cabbage. On his way home,
the farmer came to the bank of a
river and rented a boat. But crossing
the river by boat, the farmer could
carry only himself and a single one
of his purchases: the wolf, the goat,
or the cabbage.
If left unattended together, the wolf
would eat the goat, or the goat
would eat the cabbage.
Problem:
Create a Flowchart and Algorithm of all the possible solutions on how the farmer carry himself
and his purchases to the far bank of the river, leaving each purchase intact.
arrow_forward
Last weekend, Mr. Moki took Daniel to a family reunion. Since Daniel had never attended a reunion, Mr.
Moki introduced him to the four other kids in the room. Five kids then sat together. When Mr. Brown
asked about their age, the first kid A said, "I am 2 years older than B on my left." B decided to do the
same and said, "I am 2 years older than C on my left as well." C imitated, "I am 2 years older than D on
my
left." D said, "I am 2 years older than Daniel." When it came to Daniel, he answered honestly that he
was 10.
Mr. Moki burst into laughter and asked, "This is fun. How will you solve this problem?"
"I am 10, so D is 10+2=12, C is 12+2=14, B is 14+2=16, and A is 16+2=18." Daniel answered quickly. "Well
done!" said Mr. Moki, "Can any of you generalize a formula?" B reckoned that this was a recursive
relation. A, who had been learning to program, said that this could be easily implemented by a loop
Work required:
Design the algorithm and implement the algorithm using an iterative…
arrow_forward
The college ground is rectangular in shape. The Management decides to build a fence around the ground. In order to help the construction workers to build a straight fence, they planned to place a thick rope around the ground. They wanted to buy only the exact length of the rope that is needed. They also wanted to cover the entire ground with a thick carpet during rainy season. They wanted to buy only the exact quantity of carpet that is needed. They requested your help.
Help them by writing a C program to find the exact length of the rope and the exact quantity of carper that is required?
Input Format:
Input consists of 2 integers. The first integer corresponds to the length of the ground and the second integer corresponds to the breadth of the ground.
Output Format:
Refer Sample Input and Output for exact formatting specifications.
Sample Input and Output:
[All text in bold corresponds to input and the rest corresponds to output]
Length:
50
Width:
20
Required length is 140m
Required…
arrow_forward
Please use the stepsORpseudocode
arrow_forward
SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Fundamentals of Information Systems
Computer Science
ISBN:9781305082168
Author:Ralph Stair, George Reynolds
Publisher:Cengage Learning
Related Questions
- TASK 3 The Persian mathematician Al-Karaji (953-1029) computed the first description of Pascal's triangle given below. It was later repeated by the Persian poet-astronomer-mathematician Omar Khayyám (1048-1131); thus the triangle is also referred to as the Khayyam triangle in Iran. 1 1 1 1 2 1 1 3 3 1 1 4 6 4 1 15 10 10 5 1 1 6 15 20 15 6 1 1 7 21 35 35 21 7 1 The Pascal's triangle determines the coefficients which arise in binomial expressions. For example, consider the expansion (x + y)? = x² + 2xy + y = 1x³y® + 2x'y' + 1x®y?. The coefficients of the terms are in the third row of the triangle. As a general approach, In general, when x + y is raised to a positive integer power we have: (x + y)" = aox" + ax-ly + azx"-?y² + ... + an-1xy-1 + any", where the coefficients a; in this expansion are precisely the numbers on row (n+1) of Pascal's triangle. Each row of the triangle can be computed by adding the pairs of numbers in the previous row from left to right. Write, Compile and Execute…arrow_forwardA university computer science department has a teaching assistant (TA) who helps undergraduate students with their programming assignments. The TA’s office is rather small and has room for only one desk with a chair and computer. There are three chairs in the hallway outside the office where students can sit and wait if the TA is currently helping another student. When there are no students who need help, the TA sits at the desk and takes a nap. If a student arrives and finds the TA sleeping, the student must awaken the TA to ask for help. If a student arrives and finds the TA currently helping another student, the student sits on one of the chairs in the hallway and waits. If no chairs are available, the student will come back at a later time. Using threads, implement a solution that coordinates the activities of the TA and the students. Details for this assignment are provided below. The Students and the TA Using threads (Section 4.4), begin by creating n students. Each will run as…arrow_forwardA university computer science department has a teaching assistant (TA) who helps undergraduate students with their programming assignments. The TA’s office is rather small and has room for only one desk with a chair and computer. There are three chairs in the hallway outside the office where students can sit and wait if the TA is currently helping another student. When there are no students who need help, the TA sits at the desk and takes a nap. If a student arrives and finds the TA sleeping, the student must awaken the TA to ask for help. If a student arrives and finds the TA currently helping another student, the student sits on one of the chairs in the hallway and waits. If no chairs are available, the student will come back at a later time. Using threads, implement a solution that coordinates the activities of the TA and the students. Can you please write the code for above solution in javaarrow_forward
- A university computer science department has a teaching assistant (TA) who helps undergraduate students with their programming assignments. The TA’s office is rather small and has room for only one desk with a chair and computer. There are three chairs in the hallway outside the office where students can sit and wait if the TA is currently helping another student. When there are no students who need help, the TA sits at the desk and takes a nap. If a student arrives and finds the TA sleeping, the student must awaken the TA to ask for help. If a student arrives and finds the TA currently helping another student, the student sits on one of the chairs in the hallway and waits. If no chairs are available, the student will come back at a later time. Using threads, implement a solution that coordinates the activities of the TA and the students. Can you please write the code for above solution in pythonarrow_forwardA university computer science department has a teaching assistant (TA) who helps undergraduate students with their programming assignments. The TA’s office is rather small and has room for only one desk with a chair and computer. There are three chairs in the hallway outside the office where students can sit and wait if the TA is currently helping another student. When there are no students who need help, the TA sits at the desk and takes a nap. If a student arrives and finds the TA sleeping, the student must awaken the TA to ask for help. If a student arrives and finds the TA currently helping another student, the student sits on one of the chairs in the hallway and waits. If no chairs are available, the student will come back at a later time. Using threads, implement a solution that coordinates the activities of the TA and the students. Details for this assignment are provided below. The Students and the TA Using threads (Section 4.4), begin by creating n students. Each will run as…arrow_forwardWhat year did John von Neumann get his PhD from the University of Göttingen?|arrow_forward
- The Famous Gauss You must know about Gauss, the famous mathematician. Back in late 1700’s, he was at elementary school. Gauss was asked to find the sum of the numbers from 1 to 100. The question was assigned as “busy work” by the teacher. He amazed his teacher with how quickly he found the sum of the integers from 1 to 100 to be 5050. Gauss recognized he had fifty pairs of numbers when he added the first and last number in the series, the second and second-last number in the series, and so on. For example:(1 + 100), (2 + 99), (3 + 98), ..., (50 + 51). Each pair has a sum of 101 and there are 50 pairs. History repeats itself. Jojo’s teacher assign a “busy work” to the students. The teacher believes that there will be no shortcut to finish this task in a minute. The teacher gives N integers A1, A2, ..., AN to the students. The teacher also gives Q questions. Each question contains two integers L and R asking the sum of all Ai where L <= Ai <= R. As a good friend of Jojo, help Jojo…arrow_forwardOverflows You have learned the concept of overflow (with say n! that overflows at 13! for integer) Now consider Fibonacci numbers this way: 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, etc. A Fibonacci sequence f(n) is of the form: f(1) = f(2) = 1, and f(n+2) = f(n) + f(n+1) for n >= 1. 3. Write a Java computer program that prints out Fibonacci numbers in a certain data type from f(1) until f(n) with n an integer you input from the keyboard.| For short data type (signed of two bytes), the output looks like this way: Enter 1 to 6 for char, short, int, long, float, and double 2 Enter a number to find the Fibonacci series: 50 The Fibonacci series till 50 terms: Short Fibonnaci(1)= 1 Short Fibonnaci (2)= 1 Short Fibonnaci(36)= -11856 Short Fibonnaci(37)= -24967 Short Fibonnaci(38)= 28713 Short Fibonnaci(39)= 3746 Short Fibonnaci(40)= 32459 For int data type Enter 1 to 6 for char, short, int, long, float, and double Enter a number to find the Fibonacci series: 100 The Fibonacci series till…arrow_forwardputty program for unixarrow_forward
- OM 455 Section 001 Course Grading Scale Based on Course Average: Lower Upper Course Limit Limit Grade 0 59 F 60 69 D 70 79 C 80 89 B 90 100 A Midterm Final Course Last Name Score Score Average Alt 69 51 60.0 Amini 90 89 89.5 Amoako 82 78 80.0 Apland 43 77 60.0 Bachman 66 44 55.0 Corder 88 96 92.0 Desi 82 74 78.0 Dransman 58 76 67.0 Duffuor 75 89 82.0 Finkel 95 98 96.5 Foster 90 88 89.0 Fuss 74 77 75.5 George 67 90 78.5 Gerson 79 72 75.5 Girling 58 66 62.0 Greer 92 96 94.0 Guerro 67 77 72.0 Hager 64 90 77.0 Heilman 79 85 82.0 Hibbard 94 94 94.0 Hills 62 52 57.0 Hughes 76 92 84.0 Hutchison 83 93 88.0 Jackson 81 95 88.0 Kassner 85 90 87.5 Kelcik 69 84 76.5 Kern 41 75 58.0 Kinner 51 86 68.5 Lair 86 96 91.0 Marsh 88 94 91.0 Martini 65 85 75.0 Mattlin 76 82 79.0 McGough 73 74 73.5 Miller 61 80 70.5 Minnick 58 88 73.0 Minster 66 64 65.0 Mueller 68 91 79.5…arrow_forwardBirim darbe cevabı h(n) = {1, 2 ,1,-1} olan doğrusal zamanla değişmez bir sisteme uygulanan giriş işareti x(n) = , 2,3,1} ise 210007 61s210 n=0 n=0 A 21000 1693619210 10121000 B u101210007 - 1693619210101210007 - 1693619210 007 - 1600619210 u101210007 - 1693619210101210007 - 1693619210 8 u101210007 - 1693619210 2619210 u101210007 - 1693619210101210007 - 169361s210 J7-1693619210 u101210007 - 1693619210 619210 u101210007 - 1693619210101210007 - 1693619210 u10121 u101210007 - 1693619210 619210 u101210007 - 1693619210101210007 - 1693619210 u101210007 - 1693619210 19210 u101210007 - 169361921010121 u101210007 - 1693619210 19210 u10121 u101210007 - 1693619210 $19210 u10121 19210arrow_forwardO RottenAnchoredDecagons x M (no subject) - jcofield122e x O Lab 6: Module 6 - Repetitis x https://tcc.instructure.com/courses/42392/assignments/976548?module_item_id32464159 -Write a program with af as Program for Fibonacci nu x i1390rmc01171ipg (1920 x0 1390 Write a program with a for loop that displays the numbers 1 to 10 and their respective cubes. You may want to use the range function. Your output should look like the example Number Cube ****** 1 8 27 4 64 125 5. 216 343 512 8. 729 9. 1000 10 To format your table you can use the tab syntax, \t, to tab your output. For example: print("Number\t Square")arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTFundamentals of Information SystemsComputer ScienceISBN:9781305082168Author:Ralph Stair, George ReynoldsPublisher:Cengage Learning
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Fundamentals of Information Systems
Computer Science
ISBN:9781305082168
Author:Ralph Stair, George Reynolds
Publisher:Cengage Learning