Questions
4. Assignment Instructions: Please respond with at least 100 words. Your initial post should address each...

4.

Assignment Instructions:

Please respond with at least 100 words. Your initial post should address each of the topic below thoughtfully.

Topic: What are some ways to prevent out of bounds errors when reading input into C-strings?

In: Computer Science

Problem 3.73 (1-bit full adder using carry lookahead – gate level circuit) 3.73 Design a 4-bit...

Problem 3.73 (1-bit full adder using carry lookahead – gate level circuit)

3.73 Design a 4-bit full adder using carry look-ahead rather than ripple carry.

In: Computer Science

When I wrote this code in the Eclipse program, I did not see a output .....

When I wrote this code in the Eclipse program, I did not see a output .. Why?

_______
public class AClass
{
private int u ;
private int v ;
public void print(){
}
public void set ( int x , int y )
{
}
public AClass
{
}
public AClass ( int x , int y )
{
}
}

class BClass extends AClass {
private int w ;
public void print()
{
System.out.println (" u + v + w = " + ( u + v + w ) ;
}
public BClass
{
super() :
w = 0 ;
}
public BClass ( int x , int y , int z )
{
Super( x , y ) ;
w = z ;
}
}




In: Computer Science

5. Assignment Instructions: Please respond with at least 100 words. Your initial post should address each...

5.

Assignment Instructions:

Please respond with at least 100 words. Your initial post should address each of the topic below thoughtfully.

Topic: With the advent of object-oriented programming, is it ever necessary to use C-type structs rather than classes? If so, when? What are the advantages or disadvantages of each approach?

In: Computer Science

Write a program that defines an animal data type, with an animal name, age, and category...

Write a program that defines an animal data type, with an animal name, age, and category (cat, dog, etc.), as well as an animal array type that stores an array of animal pointers. Your program will prompt the user to enter the data for as many animals as they wish. It will initialize a dynamically allocated animal structure for each animal, and it will store each animal in an instance of the animal array structure. Your program will then print all the animal information to the screen. You will upload your C program as one file.

In: Computer Science

USING COMMAND PROMPT ON LINUX. show how... Linux Users, Groups, and Permissions Lab Objective: Understand how...

USING COMMAND PROMPT ON LINUX. show how...

Linux Users, Groups, and Permissions Lab

Objective:

Understand how to create user accounts
Understand how to create group accounts
Creating good password policies
Understanding permissions and file sharing

Setup:

You will need a Ubuntu Server VM

Walk Through:

You are a system administrator who has been tasked to create user accounts for new users on your system. You can pick whatever theme you like as long as there are protagonist and antagonist users: i.e. Super Hero’s and Villains, Harry Potter Characters, or other interests of yours.

Create 2 groups:
One for the Protagonists
One for the Antagonists

Create 5 users:
2 Protagonists
2 Antagonists
1 Neutral – Can access both group's files

User Configuration:
Each user will have their own home directory that only they can access.
Users must change their password when they first log in.
Users are required to change their password after 6 months.

Required Directories in /home:
1. Share – Anyone can access this directory to add or remove
2. Protagonists – Only the protagonists group can add or remove
3. Antagonists – Only the antagonists group can add or remove
***Directory names can be named based on your current theme***

Ensure that you test that each account is working by either switching users, or logging in as different users.

What to Submit:
Submit a lab report documenting your process.

Make sure to include:

  • A screenshot of the listing of the /home directory of the system showing the users home directories and the additional group directories.
  • A screenshot showing the listing of the file /etc/groups.
  • Screenshots that shows the permissions of the protagonists and antagonists directories.
  • Output from the chage -l <username> for each of the five users.

In: Computer Science

Related to HeapSort (a) Construct a heap for the following array of numbers:         8 1 2...

Related to HeapSort

(a) Construct a heap for the following array of numbers:         8 1 2 3 5 6 4 7 10 9

      Show the array after the insertion of each element into the heap.

(b) Use your heap to sort the array. Show the resulting heap after the extraction of each maximum.

In: Computer Science

PYTHON. Tasks: Create and test the openFileReadRobust() function to open file (for reading) whose name is...

PYTHON.

Tasks:

  1. Create and test the openFileReadRobust() function to open file (for reading) whose name is provided from the standard input (keyboard) – the name is requested until it is correct
  2. Create and test the openFileWriteRobust () function to open file (for writing) whose name is provided from the standard input (keyboard) – the name is requested until is correct
  3. Extend the program to count number of characters, words and lines in a file as discussed in the classby including openFileReadRobust() and openFileWriteRobust () functions
  4. Create simple tallying program to input sequence of integers (each integer 0-100) from a file (name to be entered from the keyboard using openFileReadRobust() function), compute the tally sheet discarding all bad data. Display the discarded bad data on the screen.
  5. Write the content of the tally sheet (write only non-zero counts of numbers – numbers that are in the input file) to a standard output (the shell window).
  6. Extend the program to write the content of the tally sheet (write only non-zero counts of numbers – numbers that are in the input file) to a file (name to be entered from the keyboard). Display the content of the file on the screen.

Assume the content of the file myData1.txt:

5

100

111

OK

55

5

55

5

The interaction of your program should be displayed in the Shell window similarly as shown below:

Task 1

What is the input file name?

myData.txt

This file cannot be opened

What is the input file name?

myData1.txt

Task 2

What is the output file name?

myResults1.txt

Task 3

The number of characters is: 15

The number of words is: 8

The number of lines is: 8

Task 4

Discarded bad data: 111, OK

Task 5

The tally sheet based on your input file is:

Number of 5’s: 3

Number of 55’s: 2

Number of 100’s: 1

Task 6

The tally sheet written to the file: myResults1.txt

Copy of the content of the file myResults1.txt is:

Number of 5’s: 3

Number of 55’s: 2

Number of 100’s: 1

In: Computer Science

Can you show me a UML example for the game mastermind. Using C++

Can you show me a UML example for the game mastermind. Using C++

In: Computer Science

Given a binary search tree T with n elements. For any two keys k1 and k2...

Given a binary search tree T with n elements. For any two keys k1 and k2 such that k1 < k2, there is an algorithm to print all elements x in T such that k1 ≤x ≤k2 in O(K + log n) time on average, where K is the number of the elements printed out.

In: Computer Science

Given a binary search tree T with n elements. For any two keys k1 and k2...

Given a binary search tree T with n elements. For any two keys k1 and k2 such that k1 < k2, there is an algorithm to print all elements x in T such that k1 ≤x ≤k2 in O(K + log n) time on average, where K is the number of the elements printed out.

In: Computer Science

1 ) Which of the followings is not a goal of the I/O software?    A. Device...

1 ) Which of the followings is not a goal of the I/O software?   

A. Device independence

B. Uniform naming

C. Buffering

D. Error handling

E. Cost reduction

2) According to the data rate, which of the following is not true?

A. SONET OC-768 network is faster than Gigabit Ethernet

B. FireWire 800 is slower than USB 3.0

C. SCSI Ultra 5 bus is faster than Thunderbolt 2 bus

D. Keyboard is slower than mouse

3) Which of the following is not a character device?

A. disk

B. keyboard

C. mouse

D. printer

4) The main purpose of adapting RAID (Redundant Array of Inexpensive/Independent Disks) is

A. to increase the capacity of disk

B. to improve the hard disk performance and the fault tolerance

C. to allow the data to be stored in an encrypted format    

D. to reduce the cost

E. Your answer: ___________________________________________________________

In: Computer Science

Create a PHP class named "User" with the following private fields: name, birthdate in yyyy/mm/dd format,...

Create a PHP class named "User" with the following private fields:

name,

birthdate in yyyy/mm/dd format,

age, and

department.

In the class, include getter and setter methods to get and set the values of those variables.

Author a data entry webform using HTML text input boxes and a submit button. When the user clicks on the submit button, a "User" class is instantiated and the new User object's fields are populated. The HTML input boxes correspond to the field in the "User" class.

Add an "Insert" button that allows the user to insert the form data to a MySQL table.

Add a "Display" button the displays the contents of your MySQL table on the web form when the end-user clicks on the button.

In: Computer Science

a tree is binary, if every node has at most two children nodes. prove that the...

a tree is binary, if every node has at most two children nodes. prove that the maximum of nodes in a binary tree of height h is 2^(h+1)-1

In: Computer Science

Write a program that finds and prints all of the prime numbers between 3 and X...

Write a program that finds and prints all of the prime numbers between 3 and X (X is input from the user). A prime number is a number such that 1 and itself are the only numbers that evenly divide it (for example, 3, 5, 7, 11, 13, 17, …).

One way to solve this problem is to use a doubly nested loop (a loop inside another loop). The outer loop can iterate from 3 to N while the inner loop checks to see if the counter value for the outer loop is prime. One way to see if number n is prime is to loop from 2 to n-1 and if any of these numbers evenly divides n, then n cannot be prime. If none of the values from 2 to n-1 evenly divides n, then n must be prime.

Note: do not use break statements, jumps, and user defined functions.

also tell how many prime numbers are there from 2 to n.

the language to be used is c++

In: Computer Science