Questions
I am using the program Python. Assume a function called count_primes is pre-definied. If consumes two...

I am using the program Python.

Assume a function called count_primes is pre-definied. If consumes two int arguments start and stop that returns the number of prime integers between start (inclusive) and stop (exclusive).

Note: The start value must be less than or equal to the stop value.

Enter 3 assertEqual statements to test the count_primes function.

In: Computer Science

Design and implement a program to allow a college administrator to register new students and add...

Design and implement a program to allow a college administrator to register new students and
add courses to the existing one. In addition, your program should allow the administrator to do
the following:
• Add/Remove a new student
• Add/Remove a course to/from a selected student
• Search for a student either by last name or by id.
• Search for a course either by name or by id.
• Display a selected student along with the courses s/he is registered for.
• List all registered students along with the courses each student is registered for.

Using java

In: Computer Science

Python program please no def, main, functions Given a list of negative integers, write a Python...

Python program

please no def, main, functions

Given a list of negative integers, write a Python program to display each integer in the list that is evenly divisible by either 5 or 7. Also, print how many of those integers were found.

Sample input/output:

Enter a negative integer (0 or positive to end): 5
Number of integers evenly divisible by either 5 or 7: 0

Sample input/output:

Enter a negative integer (0 or positive to end): -5
-5 is evenly divisible by either 5 or 7.
Enter a negative integer (0 or positive to end): -35
-35 is evenly divisible by either 5 or 7.
Enter a negative integer (0 or positive to end): -3
Enter a negative integer (0 or positive to end): -7
-7 is evenly divisible by either 5 or 7.
Enter a negative integer (0 or positive to end): 0
Number of integers evenly divisible by either 5 or 7: 3

In: Computer Science

a.Draw the block diagram of a 4-bit ripple carry adder using full adders. Use the black...

a.Draw the block diagram of a 4-bit ripple carry adder using full adders. Use the black box of the full adder in question 1.

b.Draw the block diagram of a 4-bit adder/subtractor circuit. The circuit should have an input (add/sub) that determines the operation (0: add, 1: subtract)

In: Computer Science

Explain recurrence including the explanation of Merge-sort and recursion tree. Then provide one example of pros...

Explain recurrence including the explanation of Merge-sort and recursion tree. Then provide one example of pros and cons.

In: Computer Science

Create a Java Program/Class named MonthNames that will display the Month names using an array. 1....

Create a Java Program/Class named MonthNames that will display the Month names using an array.

1. Create an array of string named MONTHS and assign it the values "January" through "December". All 12 months need to be in the array with the first element being "January", then "February", etc.

2. Using a loop, prompt me to enter an int variable of 1-12 to display the Month of the Year. Once you have the value, the program needs to adjust the given input to align with the array index and then confirm that the variable is in the range of 0-11. If it is not, display "Invalid Entry". If it is in range, display the string the matches the given entry. Then prompt to continue.

Tip:For the String input for the Prompt to Continue - it is preferable to use .next() instead of .nextLine(). Otherwise you will run into the Scanner Bug described in Section 3.10.

3. Display "Done" after the loop processing has ended.

Enter the Month of the Year: 1

The month name is January

Try again (Y/N): Y

Enter the Month of the Year : 2

The Month name is February.

Try again (Y/N): Y

Enter the Month of the Year : 55

Invalid Entry

Try again (Y/N): N

You can copy the code below to seed your array.:

{"January","February","March","April","May","June","July","August","September","October","November","December"};

In: Computer Science

Decide which one of the following statements is an example of Inductive OR Deductivereasoning: It is...

  1. Decide which one of the following statements is an example of Inductive OR Deductivereasoning:
  1. It is dangerous to drive on icy streets. The streets are icy now, so it is dangerous to drive now.
  2. Elephants have cells in their bodies and all cells have DNA, so elephants haveDNA.
  3. All birds have feathers and robins are birds, so robins have feathers.
  4. Red meat has iron in it and beef is red meat, so beef has iron in it.
  5. John is an excellent swimmer. John’s family has a swimming pool. John’s sister Mary must also be an excellent swimmer.
  6. Ray is a football player. All football players weigh more than 170 pounds. Ray weighs more than 170 pounds.

In: Computer Science

The project description: As a programmer, you have been asked to write a Java application, using...

The project description: As a programmer, you have been asked to write a Java application, using OOP concepts, for a Hospital with the following requirements: • The Hospital has several employees and each one of them has an ID (int), name (string), address (string), mobile phone number (string), email (string) and salary (double) with suitable data types. • The employees are divided into: o Administration staff: who have in addition to the previous information their position (string). o Doctor: who have also a rank (string) and specialty (string). The project requirements: • You will need to create all the needed Java classes with all the required information. • You have to apply all the OOP (Object Oriented Programming) concepts that we have covered in this module (i.e. inheritance, polymorphism, interface and collections) • Include a Microsoft Word document (name it as readme.doc) that includes several screenshots of your Netbeans IDE application GUI interface as well as the output screenshot results. Provide all assumptions that you have made during design and implementation. • Include the whole Netbeans Java project with all source codes. Write as much comments as possible to document your source codes. At the end, you will need to create a testing class (e.g. Hospital.java) with the static main() method with the following requirements: • It must have initial fixed collections of working staff (at least 3 administration staffs and 2 doctors) • The program will print a selection screen where the user can choose the operation he/she wants to perform. The selection screen will be repeated after each selection until the staff type the number 4 to completely exit from the program: 1. Add an administration staff (by providing all her/his information) to the list of all administration staff 2. Add a doctor (by providing all her/his information) to the list of all doctors 3. Print all working staff (remember to differentiate between administration staff and doctors in the output printout 4. Exit the program

In: Computer Science

Your first project is to build your own home page. The page should be some sort...

Your first project is to build your own home page. The page should be some sort of introduction to you, and include more than a single page.

Other than that, there are no rigid guidelines as to what these pages should contain.

If you're looking for ideas of what to put into your personal pages, here are some starters:

  • Information about you
  • Information about your occupation and your job
  • Friends and Family
  • Pets
  • Spouse/SO/Partner
  • Your most recent vacation
  • Favorite TV shows (Tip: Link to the show's/movie's site or to its page on imdb.com
  • Where and with whom you live
  • What you do with your spare time (if you have any)
  • Any organizations to which you belong or sponsor
  • You can include some opinions or articles you may have written.

These are just ideas, though. What you put on your home site is entirely up to you.

You might want to consider your audience a specific group, such as classmates and the instructor--in which case you might want to include information such why you're taking this class, what kind of computer and 'net connection you're using, etc. Or, you may want to make your audience anyone who might be interested in or you know

In: Computer Science

Write code that classifies a given amount of money (which you store in a variable named...

Write code that classifies a given amount of money (which you store in a variable named amount), specified in cents, as greater monetary units. Your code lists the monetary equivalent in dollars (100 ct), quarters (25 ct), dimes (10 ct), nickels (5 ct), and pennies (1 ct). Your program should report the maximum number of dollars that fit in the amount, then the maximum number of quarters that fit in the remainder after you subtract the dollars, then the maximum number of dimes that fit in the remainder after you subtract the dollars and quarters, and so on for nickels and pennies. The result is that you express the amount as the minimum number of coins needed. Please show me how to do it in the jupyter notebook.

In: Computer Science

Discuss how to implement an isolated test lab environment to test DHCP split scope, failover scope,...

Discuss how to implement an isolated test lab environment to test DHCP split scope, failover scope, and security configurations.

In: Computer Science

List four alternate terms for "physical address". Name the TCP/IP model layers, and map them to...

  1. List four alternate terms for "physical address".
  1. Name the TCP/IP model layers, and map them to the corresponding OSI model

layers.

  1. At which TCP/IP model layer(s) do UDP and TCP reside?
  1. List five TCP/IP model application layer protocols.
  1. You are converting your network to an IP addressing scheme. You assign a junior administrator the task of assigning addresses to your network hosts from the IP address range 202.17.68.0-202.17.68.255. He states that he used every one of the 256 addresses in the range. Which devices on the network will be unable to communicate with other network devices?

In: Computer Science

Python 3.7: Give the following sample code, write the following programs: • An iterator class called...

Python 3.7:

Give the following sample code, write the following programs:
• An iterator class called Iteratefirstn that implements __iter__() and __next__() methods where next method should raise an exception for the cur index if it is passed the last element otherwise set cur index to the next index and advance the index by one, i.e. cur, num = num, num+1. Instantiate the class to calculate the sum of 1000000 elements similar to the example.
• Instead of implementing the class, write a generator function that does the same thing.
Sample code:
def firstn(n):
num, nums = 0, []
while num < n:
nums.append(num)
num += 1
return nums
sum_of_first_n = sum(firstn(1000000))  

In: Computer Science

JAVA I need to make it that I can expand the stack for everytime a push...

JAVA

I need to make it that I can expand the stack for everytime a push operation is performed that would normally cause an overflow, returning a false value. Should accompany 3 nodes initially.

DriverStack.java

public class DriverStack {
  
public static void main (String[] args)
{
  
Stack s = new Stack(3);
Listing l;
Listing l1 = new Listing ("Bill", "1st Avenue", "123 4567");
Listing l2 = new Listing ("Alec", "2nd Avenue", "456 4567");
Listing l3 = new Listing ("James", "3rd Avenue", "367 8896");
Listing l4 = new Listing ("Nico", "4th Avenue", "322 1156");
  
System.out.println(s.pop());
System.out.println(s.push(l1));
System.out.println(s.push(l2));
System.out.println(s.push(l3));
System.out.println(s.push(l4));
  
System.out.println("\n");

System.out.println("----------------All listings with one over flow----------------" + "\n");
  
s.showAll(); //shows listings
  
System.out.println("----------------Tries to pop the Listing '1'----------------" + "\n");

//Three pop operations
l = s.pop();
System.out.println(l.toString());
  
l = s.pop();
System.out.println(l.toString());
  
l = s.pop();
System.out.println(l.toString());


l = s.pop(); //will try to pop an already empty stack
  
System.out.println(l);
System.exit(0);
  
}
  
}

Stack.java

public class Stack
{
private Listing[] data;
private int top;
private int size;
  
public Stack()
{
top = -1;
size = 3;
data = new Listing[3];
}
public Stack (int n)
{
top = -1;
size = n;
data = new Listing[n];
}
  
public void settop()
  
{
top=-1;
}
  
  
public boolean push(Listing newNode)
{
if(top == size - 1)
return false; //overflow
else
{

top = top + 1;
data[top] = newNode.deepCopy();
return true;
}
}
  
public Listing pop()
{
int topLocation;
if(top == -1)
  
return null; //underflow error
else
{
topLocation = top;
top = top - 1;
return data[topLocation];
  
}
}
  
public void showAll()
{
for (int i = top; i >= 0; i--)
System.out.println(data[i].toString());
  
}
  
public void initialStack()
{
top = -1;
}
  
public boolean StackEmpty()
  
{
if(top == -1)
return true;
else
return false;
  
}
  
public boolean StackFull()
  
{
if(top == size-1)
return true;
else
return false;
  
}
  
public Listing peek()

{

if(StackEmpty())

{

System.out.println("Stack is underflow");

return null;

}

else

{

return data[top];

}

}
  
  

  
}

There is one more class called Listing but I dont think anything needs done with that.

Please comment next to the new code that was added, Thank you!

In: Computer Science

4NCA: 4.1 List ways in which secret keys can be distributed to two communicating parties. 4.2...

4NCA:

  • 4.1 List ways in which secret keys can be distributed to two communicating parties.

  • 4.2 What is the difference between a session key and a master key?

  • 4.3 What is a key distribution center?

  • 4.4 What entities constitute a full-service Kerberos environment?

  • 4.5 In the context of Kerberos, what is a realm?

  • 4.6 What are the principal differences between version 4 and version 5 of Kerberos?

In: Computer Science