Questions
Define a class Shoe with the following properties & methods. ForGender – r/w property (legal values:...

  1. Define a class Shoe with the following properties & methods.
  • ForGender – r/w property (legal values: M or F – define a public enum in the class)
  • Brand – r/w property (string)
  • US_ShoeSize – r/w property (decimal). Must be between 2 and 20 (throw an error if not).
  • UK_ShoeSize – public read-only & private set property. 0.5 smaller than US_Size for men’s shoes, 2.5 smaller for woman’s shoes.
  • Constructor method that sets the initial Brand, US_ShoeSize, ForGender of the shoe.

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...

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 To install packages you will need root privelages. To temporarily perform an action with root...

linux

  1. To install packages you will need root privelages. To temporarily perform an action with root privileges you use the sudo command demonstrated in item 6 below. In your own words, explain the purpose of the sudo command and why sudo is a better choice than logging in as the root user.
  2. Make sure your package listings are up to date by running the following command.

$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.

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...

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...

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...

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:

  • You should only add code to the cursor_insert method; the rest of ArrayList is provided for reference and testing purposes only. cursor_set is already provided.
  • You must adhere to the same rules when using the built-in Python list as you did in the ArrayList lab.
  • Assume that cursor is set to a value between 0 and the length of the list (inclusive) when cursor_insert is called.
  • You may not use any other data structures (this includes the built-in Python list).

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...

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
1) return check_board_full function return value

+

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.
2)In function set player(private variable) to first_player function argument.
3) After the conditional branch statement, call the clear_board function

+

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.
2) Private data player can’t be empty “”, throw an Error exception if player variable is “”. Error Message: Must start game first.

3) Call set_next_player private function

+

string get_player() const

Return the next_player value

+

New

void display_board const

No parameters
Iterate vector of strings pegs to
Display a tic tac toe board in 3x 3 format

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
1) return false if vector of strings pegs has available slot by checking for a “ “(space)in each element. Otherwise return true

-

New

void clear_board const

No parameters
1) Set all 9 elements to a “ “ (space)

Class private Data

-

string player

Class member variable

New

vector of string pegs

Class member variable
1) (initialize to 9 “ “(spaces)



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
2) Call the start game function
3) Use REQUIRE_THROWS_AS to verify game.mark_position(0) throws an Error
4) Use REQUIRE_THROWS_AS to verify game.mark_position(10) throws an Error
5) Call mark board 5 to show that an Error is not thrown.
  

Test game over if 9 slots are selected.

1)Create an instance of TicTacToe game
2)Call the start game function
3)Call mark board 9 times using numbers 1 to 9 in the following order(this test case will eventually be the test for CAT tie case)

In: Computer Science

Describe a non-deterministic Turing machine algorithm that takes one integer and checks for primality. What is...

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 Use apt-get to UNINSTALL the appropriate text editor package for your distribution. If you are...

linux

  1. Use apt-get to UNINSTALL the appropriate text editor package for your distribution. If you are using Ubuntu uninstall vim-tiny since it is no longer needed. If you are using Lubuntu, uninstall emacs (or tell me the command to uninstall it if you would like to continue using emacs). Paste the output of the installation information or a screenshot of that output below along with your command.

$

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...

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...

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...

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...

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...

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