Demonstrate using the class and its properties/methods in C#.
In: Computer Science
6a) (6 pts. each) Find the decimal represented by the 32-bit single precision floating point number for the hexadecimal value C47CD000.
In: Computer Science
linux
$sudo apt-get update
When this command is done you will see a line that says how much
data was fetched. Paste that line here.
Now describe what apt-get update does? Why is this important?
In: Computer Science
Describe how typical RESTful services respond to requests.
In: Computer Science
Write a bash script to find all the files ending with .c recursively for every directory in your current working directory, then copy each one to a folder called programs, need handle duplicates by appending the number to the end of the file (ex main.c main-1.c ) compile them and generate a report
report should look like:
main.c compiles
prog2.c failed
main-2.c compiles
etc.
In: Computer Science
Microsoft Visual C++ Assembly language
Problem 3. Write a program that uses a loop to calculate the first seven values of the Fibonacci number sequence, described by the following formula: Fib(1) = 1, Fib(2) = 2, … Fib(n) = Fib(n-1) + Fib(n-2). Place each value in the EAX register and display it with a call DumpRegs statement inside the loop
For example:
Fib(1) = 1,
Fib(2) = 2,
Fib(3) = Fib(1) + Fib(2) = 3,
Fib(4) = Fib(2) + Fib(3) = 5,
Fib(5) = Fib(3) + Fib(4) = 8,
Fib(6) = Fib(4) + Fib(5) = 13,
Fib(7) = Fib(5) + Fib(6) = 21
Below is an assembly program template that you can refer, and complete the programming by filling in the codes into the specified place:
TITLE Midterm Programming Question 3
Comment !
Description: Write a program that uses a loop to calculate the first
seven values in the Fibonacci number sequence { 1,1,2,3,5,8,13 }.
Place each value in the EAX register and display it with a
call DumpRegs statement inside the loop.
!
INCLUDE Irvine32.inc
.code
main PROC
please fill in your code here
exit
main ENDP
END main
Please submit the source code of your assembly file (i.e. .asm) and the screenshot to show that your program works well
In: Computer Science
python 3
We would like to add cursor-based APIs to the array-backed list API. To this end, we are including a cursor attribute, and two related methods. cursor_set will set the cursor to its argument index, and cursor_insert will insert its argument value into the list at the current cursor position and advance the cursor by 1.
E.g, given an array-backed list l that contains the values [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], running the following code
l.cursor_set(5) l.cursor_insert('a') l.cursor_insert('b') l.cursor_insert('c')
will result in the updated list [0, 1, 2, 3, 4, 'a', 'b', 'c', 5, 6, 7, 8, 9]
When the cursor is set to the length of the list, cursor_insert should behave like append.
Programming rules:
class ArrayList:
def __init__(self):
self.data = []
self.cursor = 0
def append(self, val):
self.data.append(None)
self.data[len(self.data)-1] = val
def cursor_set(self, idx):
self.cursor = idx
def cursor_insert(self, val):
# YOUR CODE HERE
In: Computer Science
C++
The program will call the start_game function with argument O or
X to indicate first player and will keep track of the next player
while players take turns marking the board until the board is full.
This version of the game only plays one game.
Class Specifications
TicTacToe class does not have a
constructor.
Member Functions and Member(variable)
Specifications
+ = public
- = private
public/private |
New /Update/NoUpdate |
Function/Data Member |
Functionality of function or data member |
|
+ |
New |
bool game_over |
No parameters |
|
+ |
Update |
void start_game(string first_player) |
1) first_player function argument value must be X or O;
otherwise, throw an Error exception when value is not X or O. Error
Message: Player must be X or O. |
|
+ |
void mark_board(int position) |
1) Value of int must be in the range 1 to 9; otherwise, throw an
Error exception if value not in this range. Error Message: Position
must be 1 to 9. |
||
+ |
string get_player() const |
Return the next_player value |
||
+ |
New |
void display_board const |
No parameters |
|
private functions |
||||
- |
void set_next_player() |
Set next_player. If private variable player X, player is O else player is X |
||
- |
New |
void check_board_full |
No parameters |
|
- |
New |
void clear_board const |
No parameters |
|
Class private Data |
||||
- |
string player |
Class member variable |
||
New |
vector of string pegs |
Class member variable |
||
UNIT TEST CASES
Required Test Cases for Assignment (write the code in
/homeworks/tic_tac_toe_test/ tic_tac_toe_test.cpp)
Test Case Name |
Steps to Test |
Test Mark Position accepts values from 1 to 9 only |
1) Create an instance of TicTacToe game |
Test game over if 9 slots are selected. |
1)Create an instance of TicTacToe game |
In: Computer Science
Describe a non-deterministic Turing machine algorithm that takes one integer and checks for primality. What is the complexity of the algorithm?
In: Computer Science
linux
$
Output of installation information:
2.What command can you use to verify that vim-tiny or emacs is
now uninstalled?
$
In: Computer Science
Implement if else loop to find out if the given number is positive or negative or zero. You would be hardcoding the number in the below example I used 8. But you can use a different number.
In: Computer Science
Consider a binary search tree created from the following values:
47 9 52 24 0 23 44 15 63 45 67
If the node containing the value 23 were to be
deleted, what value would replace it?
In: Computer Science
A Private Poly Clinic in Oman wish to develop software to automate their Patient Monitoring system for storing the details of the patients visited the clinic. Develop a system to meet the following requirements:
Develop an algorithm, flow chart and write a Looping in C program to read the gender of
patients and fees to be paid by them as shown in the below table. Calculate the
total fees paid by the female and male patients separately and display them
with appropriate statements.
Patient Id |
Fees in (OMR) |
Gender |
P001 |
15 |
M |
P002 |
10 |
F |
P003 |
20 |
M |
P004 |
8 |
F |
P005 |
12 |
M |
In: Computer Science
Suppose that the WTAMU post-office wants to develop a new system that will give its user more on-line experience. The post office plans to serve WTAMU students identifying through their ID, or with help from the university information. The new system will facilitate as like the IT service center, a student/faculty/staff will be allowed to create tokens to send/receive their mails, and the post office workers will collect the mail from the service location.
You have been put in charge of designing the project. Develop a plan for estimating the project. Create a work-plan listing the tasks that will need to be completed to meet the project’s objectives. Create a Gantt chart or a network diagram to graphically show the high-level tasks of the project.
In: Computer Science
a) Explain the process of data encapsulation using the following terms: data, segment, packet frame, and bits. [5 marks]
b) Using an application of your choice, explain how the process works. [3 marks]
2.
A network infrastructure contains three categories of network components: End devices, Intermediary Devices, and Network Media.
a) For each category, list two examples and briefly describe each example’s main function, i.e. six examples in total. [3 marks]
b) Describe in details how you connect a desktop PC to the Internet. Starting from your ISP, list and explain all the hardware involved, and what layer each component is in. [3 marks]
In: Computer Science