- Write a method sum that expects a List<Integer> as a parameter. The method returns an int representing the sum of the integers in the list.
- Write an index-based loop that prints the contents of a list.
In: Computer Science
Describe the rules and regulation in disposal of hazardous waste and municipal solid waste.(50marks)
Need own answer and no internet answers r else i il downvote nd report to chegg.Even a single is wrong i il downvote.its 50marks question so no short answer minimum 10page answer required and own answer r else i il downvote.
Note:Minimum 10page answer and no plagarism r else i il downvote and report to chegg.Minimum 10 to 15page answer required r else dnt attempt.strictly no internet answer n no plagarism.
its 50marks question so i il stricly review nd report
In: Computer Science
In the following questions you will be designing a class called SuperDraw to
generate lotto numbers and manage the process of verifying whether a ticket
is a winner. Every lotto ticket has 6 numbers generated randomly between 1
and 49. A number cannot be repeated in the same ticket.
The main SuperDraw class structure should look like the following:
struct ticket
{
unsigned int numbers[6];
ticket* next;
};
class SuperDraw
{
private:
ticket* ticketListHead;
ticket* ticketListTail;
public:
SuperDraw(/* args */);
~SuperDraw();
};
ticket
is a linked list structure that holds the 6 lotto numbers in an array and a pointer to
the next element in the list. Notice that the class SuperDraw has 2 private data members,
ticketListHead and ticketListTail. They are 2 pointers pointing to the head (first element)
and the tail (last element) of the linked list.
Question 1 (5 pts)
Complete the implementation for the class SuperDraw by implementing the constructor
and the destructor bodies if needed. Constructor should be initializing the object to
whatever initial suitable state.
Question 2 (15 pts)
Add a public method called newTicket(int verbose = 0) that generates random 6 numbers.
The newly created ticket should be added to the linked list and the randomly generated
numbers should be printed out to the screen if verbose argument is set to 1. By default the
verbose argument is set to 0 which means that no messages will be printed out to the
screen.
The numbers should be sorted in ascending order.
Remember that the pointers ticketListHead and ticketListTail should be updated
accordingly after the generation of each new ticket
The test main() function should look like the following:
int main()
{
SuperDraw sd;
sd.newTicket(1);
}
The output should be something like:
A new ticket was successfully generated. The numbers are: 12, 14, 23, 39, 40, 44
Add a constructor that takes an int argument which corresponds to the number of tickets
to be generated.
Question 3 (10 pts)
The test main() function should look like the following:
int main()
{
SuperDraw sd(2);
}
The output should be something like:
2 new ticket were successfully generated.
The numbers are: 12, 14, 23, 39, 40, 44 and 1, 2, 9, 12, 28, 41
In: Computer Science
You will follow a contract-first approach using interfaces. Here are the main specifications of the contract to build the graph application. There are four interfaces.
ILocation: defines a generic interface for any location object
|
ILocation |
ILocation2D: defines an interface for 2D locations
|
ILocation2D |
ILocation3D:
|
ILocation3D |
ICity: defines an interface for City objects.
|
ICity |
IRoute: define a generic interface for a route.
|
IRoute |
In: Computer Science
Name a few operating systems that you worked on (or had contact with).
Describe your experience and answer comparative questions like:
- Which one was the oldest / most recent?
- Which one was the oddest? why? - Which one was more fun? why?
- Which particular OS feature do you like most? why?
- Which particular OS feature do you dislike most? why?
In: Computer Science
To be done in Python 3.7
Some Web sites impose certain rules for passwords. Write a function that checks whether a string is a valid password. Suppose the password rules are as follows:
A password must have at least eight characters.
A password must consist of only letters and digits.
A password must contain at least two digits.
Write a program that prompts the user to enter a password and displays valid password if the rules are followed or invalid password otherwise.
Your program should define a class called Password, which is in its own file called password.py. You should have another file called assn13-task2.py that has code the creates and uses a Password object. All input and print functions should be in in this file. Your program will prompt the user for a password, and after completing will ask the user if they want to enter another. The program should only ever create one instance of Password. Your Password class should have at least the following:
In: Computer Science
Write an 8088/8086 assembly program that counts the length of a null terminated string that starts at location STR.print The result on the screen Assume string length will not exceed 255 character.
In: Computer Science
The purpose of this question is to develop a web page to determine if two line segments represent the diagonals of a square or not. The first line segment L1 is bounded by the two points (x1, y1 ) and (x2, y2 ) while the second line segment L2 is bounded by the two points (x3, y3 ) and (x4, y4 ).
Keep in mind that the lengths of the diagonals of a square are equal and bisect each other at right angles. So you need to find the length, slope and midpoint of each line segment in order to determine if they represent the diagonals of a square or not. Remember that two line segments are perpendicular if the multiplication of their slops equals -1.
In this question you might need to search for formulas in some math textbooks or in the e-library to calculate the slope, x coordinate and y coordinate of the midpoint and length of a line segment.
The web page should be implemented by using HTML tags and PHP codes.
The designed web page should include a title, a header, an input form for entering the values of the four points, only numerical values, and an output form for presenting the slopes, lengths, midpoints of the two line segments and the error messages if any. The design and the layout of the web page are left intentionally for the student to distinguish his/her TMA form other students and to show his/her creativity in designing the web page.
The PHP part should include at least four PHP functions; three functions for calculating the slope, coordinates of the midpoint and the length of a line segment. And another function for determining if two line segments represents the diagonals of a square or not.
In: Computer Science
7. __________________ representation of a binary number uses the bit following (after)
the most significant bit as the sign bit, making it possible to determine whether an
integer is negative or positive.
A). 2’s complement
B). 1’s complement
C). bitwise complement
D). bitwise negation
8. To obtain the 2’s complement of a binary number, it is necessary to flip (reverse) the
bits and ___________________________.
A). subtract 1
B). divide by 1
C). complement by 1
D). add 1
9. An overflow condition in signed numbers has occurred when ___________________.
A). the carry into the sign bit is different from the carry out of the sign bit
B). the carry into the sign bit equals the carry out of the sign bit
C). the carry into the sign bit is a multiple of 10 of the bit value on the carry out of the
sign bit
D). the carry into the sign bit is a negative value
10. Expresed as a series of 8 bits, the binary number that results from the addition of the
decimal (base 10) numbers 120 and –132 is ___________________________.
A). 00010100
B). 01010000
C). 11110100
D). 00000011
11. The hexadecimal (base 16) equivalent of the binary (base 2) number 110111110111
is _________________________.
A). FE7
B). DF7
C). D0E
D). EAD
12. In the EBCDIC collating sequence, lower case alphabetic characters ‘a’ thru ‘z’ are
considered to _____________ in value than upper case alphabetic characters A
thru Z.
A). be lower
B). be higher
C). be equal
D). have more precision
13. One of the inherent problems with migrating code from EBCDIC-based systems to
ASCII-based systems is that ____________________________________________.
A). the executable code will run slower on an ASCII-based system than on an
EBCDIC-based system
B). output results from sort routines and SQL queries may differ between the two
systems depending on the specific database values being processed
C). system performance bottlenecks will occur when the executable code runs on the
ASCII-based system that did not exist when the executable code ran on the
EBCDIC-based system
D). executable code running on EBDCIC-based systems cannot be optimized to run
faster.
14. Three common Boolean operators are _________________________________.
A). ADD, SUBTRACT, and DIVIDE
B). NOT, DIVIDE, and EXCLUSIVE OR
C). NOT AND, NOT OR, and EXCLUSIVE OR
D). AND, OR and NOT
15. When the Boolean operator __________ is applied to a Boolean expression, the result
is the complement of the expression.
A). NOT
B). OR
C). AND
D). bitwise complement
16. The basic physical component of a computer is the __________________; the basic
logic element is the _______________.
A). motherboard, transistor
B). transistor, multiplexer
C). transistor, gate
D). gate, transistor
17. The rules of precedence of Boolean operations are __________________________.
A). the OR operator has highest precedence, followed by the NOT operator, then the
AND operator
B). the NOT operator has highest precedence, followed by the AND operator, then
the OR operator
C). the AND operator has the highest precedence, followed by the OR operator, then
the NOT operator
D). the NOT operator has highest precedence only when followed by the OR
operator
18. A(n) ______________ is an electronic device that produces a result based on two or
more input values.
A). gate
B). arithmetic logic unit
C). transistor
D). central processing unit
19. The output of the ________________ Boolean operation is true only when the values
of the inputs differ.
A). NOT AND (NAND)
B). NOT OR (NOR)
C). EXCLUSIVE OR (XOR)
D). ANDOR (AOR)
In: Computer Science
A __________________ is a combinational circuit that is useful in selecting a
memory location according to a binary value that is placed on the address lines of a
memory bus.
A). multiplexer
B). gate
C). transistor
D). decoder
21. A _______________ is a combinational circuit that selects a single output from
multiple inputs.
A). decoder
B). multiplexer
C). AND gate
D). OR gate
22. ___________________ creates logic diagrams using the values specified in a truth
table.
A). Digital synthesis
B). Digital analysis
C). Circuit design
D). An Embedded system
23. The two principal parts of the CPU are the _____________ and the ____________.
A). memory bus, arithmetic logic unit
B). memory bus, registers
C). datapath, control unit
D). datapath, arithmetic logic unit
24. A ___________ allows the CPU to share data with other system components.
A). logic bus
B). memory bus
C). system bus
D). data bus
25. System bottlenecks can arise from the use of a ___________________________ bus
arbitration scheme when a centralized arbiter selects which process gets the bus.
A). centralized parallel arbitration
B). distributed arbitration using self-selection
C). daisy chain arbitration
D). distributed arbitration using collision detection
26. Under which of the following scenarios can CPU throughput be improved?
A). Reducing the number of instructions in a program.
B). Reducing the number of clock cycles per instruction.
C). Reducing the number of nanoseconds per clock cycle.
D). All of the above.
27. ___________ are all input devices which allow us to enter data into a computer.
A). monitors, printers, speakers
B). keyboards, mice, scanners
C). keyboards, printers, plotters
D). printers, mice, touch screens
28. When the normal execution of a program is altered because an event of higher
priority occurs, the CPU is alerted to such an event through a(n) ________________.
A). bottleneck
B). interrupt
C). latency condition
D). abend
29. The ____________________________ of a computer specifies the instructions that
the computer can perform and the format for each instruction.
A). instruction set architecture
B). registers and buses
C). opcodes
D). clock cycles
30. Interrupts that cannot be suspended but must be processed in order to keep the system
in a stable condition are called __________________ interrupts.
A). detectable
B). forseeable
C). maskable
D). nonmaskable
Section B: True or False Questions
Each of the following questions is either True or False. Place a T (True) if the answer is True on the answer sheet beside the question; otherwise place a F (False) if the answer is False on the answer sheet beside the question.
31. The job of an assembler is to convert assembly language into machine language.
T F
32. The arithmetic logic unit is responsible for decoding the binary value in an instruction
register and creating all necessary control signals needed to execute the appropriate
microoperation.
T F
33. To support the passing of parameters between programs, a
stack data structure is
used.
T F
34. A systems architecture that is backward compatible permits programs written on a
newer, faster processor to run just as fast on a less powerful and older processor.
T F
35. There are 230 megabytes in a terabyte.
T F
36. The decimal (base 10) number 210 is equivalent to 11010010 in binary (base 2) and
D5 in hexadecimal (base 16).
T F
37. The hexadecimal number C9D is equivalent to the binary number 110010011101.
T F
38. A program counter points to the memory address of the instruction that the CPU is
currently executing.
T F
39. While statements and if statements are examples of conditional branching
instructions.
T F
40. Obtaining the binary equivalent of a decimal (base 10) integer with a negative sign
requires a bitwise complement of the bits in the positive decimal (base 10) integer
value of the same magnitude.
T F
In: Computer Science
Explain the following : Factors driving adoption of intelligent actions within the IoT
• Lower machine prices
• Improved machine functionality
• Machines “influencing” human actions through behavioral-science rationale
• Deep Learning tools
2. Explain the following : Challenges facing the adoption of intelligent actions within IoT
• Machines’ actions in unpredictable situations
• Information security and privacy
• Machine interoperability
• Mean-reverting human behaviors
In: Computer Science
An established financial company is about to launch their new banking application. Give 5 reasons why the company should use their own data centre rather than cloud computing.
In: Computer Science
In: Computer Science
Describe the steps which you would take on AWS and the decisions that would need to be made to create, configure and run a Virtual Machine Instance
In: Computer Science
In: Computer Science