Questions
Write Python code that asks the user for a password from the console and continues asking...

Write Python code that asks the user for a password from the console and continues asking for a password until the user enters a password that has greater than 10 characters.

(language python)

In: Computer Science

1. List ALL the different type of network connections involved in the operations for each of...

1. List ALL the different type of network connections involved in the operations for each of the scenarios below. Provide an illustration for each of the scenarios.

Scenarios a. You have just bought a new mobile phone from an online shop. You have decided to take a few snapshots of your best friend and send them to the email account of a mutual friend across the country. b. You are driving around in an unfamiliar city and have just gotten lost. By using your mobile phone’s GPS system, you submit a request for driving directions from a nearby intersection to your destination.

2. Broadcast networks refer to networks such as LANs connected by a technology such as Ethernet. Broadcast networks, by nature, are multiaccess where all routers in a broadcast network can receive a single transmitted packet. Discuss the requirements or deficiencies of a network layer (OSI layer 3 and TCP/IP layer 2) in a broadcast network.

In: Computer Science

Variable trials refers to a list where each list item is another list of 3 integers...

Variable trials refers to a list where each list item is another list of 3 integers between 0 and 9. Imagine each list of 3 integers is a combination of numbers of a lock. Further suppose the variable code refers to a list of three integers that is the correct combination of the lock.

Write a program which, assuming trials and code are already defined, prints out a character for each digit of each trial. Print Y if the digit in the trail matches the digit at the same position in the code. Print # if the digit in the trial does not match the digit at the same position in the code but appears elsewhere in the code. Print N if the digit of the trial does not match the digit in the code and the digit in the trial appears nowhere in the code. Print a newline after the characters after three numbers (for each trial).

Example, if trails = [[2,3,4], [5,5,5], [5,2,3]], and code = [2,3,5], the program output should be:

Y Y N

# # Y

# # #

Hint: the in and not in operators can be used to test whether an item appears in a list.

(language python.)

In: Computer Science

Show the calculation steps for each of the problems below. a. Using Nyquist’ theorem, calculate the...

Show the calculation steps for each of the problems below.

a. Using Nyquist’ theorem, calculate the channel capacity C of a signal that has 18 different levels and a frequency of 50,000 Hz.

b. Using Shannon’s theorem, calculate the data transfer rate given the following information, signal frequency= 25,000 Hz; signal power = 5000 watts; noise power = 320 watts.

c. Using Nyquist’s theorem and given a frequency of 8000 Hz and a data rate of 90,000 bps, how many signal levels (L) will be needed to convey this data?

d. The signal-to-noise ratio is often given in decibels. Assume that SNRdB = 28 and the channel bandwidth is 8 GHz, what is the theoretical channel capacity?

In: Computer Science

You are provided with the files "Song.java" and "SongList.java". You are required complete the methods in...

You are provided with the files "Song.java" and "SongList.java". You are required complete the methods in the latter file to implement the sorted circular linked list. The list is sorted according to the title of each song in alphabetical order. You need to write these methods: add(String artist, String title) – This method takes an artist and a title and adds a Song node with these values into the list. The list must still be sorted in ascending order by song title. You do not need to handle duplicates – you can assume that we never insert the same song for more than once. This method takes an artist and a title and remove a Song node that matches the artist and the title from the list. If remove is successful, return true. If no such node exists, return false. buildList(String artist) – This method takes an artist and searches in the list for all the song nodes associated with this artist. It then adds all these nodes into a new sorted circular linked list and returns it as a SongList object. Do not alter the original song list in this method.

public class Song
{
// instance variables
private String m_artist;
private String m_title;
private Song m_link;

// constructor
public Song(String artist, String title)
{
m_artist = artist;
m_title = title;
m_link = null;
}

// getters and setters
public void setArtist(String artist)
{
m_artist = artist;
}

public String getArtist()
{
return m_artist;
}

public void setTitle(String title)
{
m_title = title;
}

public String getTitle()
{
return m_title;
}
  
public void setLink(Song link)
{
m_link = link;
}

public Song getLink()
{
return m_link;
}
}

public class SongList
{
// instance variables
private Song m_last;
private int m_numElements;

// constructor
// Do not make any changes to this method!
public SongList()
{
m_last = null;
m_numElements = 0;
}

// check whether the list is empty
// Do not make any changes to this method!
boolean isEmpty()
{
if (m_last == null)
return true;
else
return false;
}

// return the size of the list (# of Song nodes)
// Do not make any changes to this method!
public int size()
{
return m_numElements;
}

// add a new Song to the circular linked list with the given artist and
// title, keeping the list sorted by *song title*.
public void add(String artist, String title)
{
// TODO: implement this method
}

// remove a Song associated with the given artist and title from the list,
// keeping the list sorted by *song title*.
public boolean remove(String artist, String title)
{
find(artist);
if(found)
{
if (Songlist == Songlist.getLink())
list = null;
else if (previous.getLink() == Songlist)
previous.setLink(m_last.getLink());
numElements--;
}
  
return found;

}
  
  
// build and return a circular linked list that contains all songs from the
// given artist
public SongList buildList(String artist)
{
// TODO: implement this method
}
  
// return a string representation of the list
// Do not make any changes to this method!
public String toString()
{   
String listContent = "";
Song current = m_last;
  
if (m_last != null)
do
{
current = current.getLink();
listContent += " [" + current.getArtist() + " - " + current.getTitle() + "]\n";

} while (current != m_last);

return listContent;
}
}

In: Computer Science

In Java inputs and output values can easily be manipulated, for example when dealing with money...

In Java inputs and output values can easily be manipulated, for example when dealing with money the value should always be formatted to 2 decimals or another use is separating of words in even spaces, line breaks and etc. Your task is to prompt the user for 2 numbers one integer the other decimal and print their product in money format. The program should also take in two words delimitated by @ symbol.

Sample run 1:
Enter a whole number: 4
Enter a decimal number: 6.854
Enter two words delimitated by @ symbol: Mango@15@
Output:
The product of the 2 numbers: 27.416
The product in money format is: N$ 27.42
Assuming the user bought 4 Mango(s) costing N$ 6.85
The VAT to be charged is 15%, hence total due to be paid is N$ 31.53
[Hint: The two word provided are the item sold and the VAT charged, which is added on the product calculation. For formatted printing and keyboard input see page 129 – 139 in the prescribed book]

In: Computer Science

Python question Write a program that asks the user to enter a student's name and 8...

Python question

Write a program that asks the user to enter a student's name and 8 numeric tests scores (out of 100 for each test). The name will be a local variable. The program should display a letter grade for each score, and the average test score, along with the student's name.

Write the following functions in the program:

calc_average - this function should accept 8 test scores as arguments and return the average of the scores per student

determine_grade - this function should accept a test score average as an argument and return a letter grade for the score based on the following grading scale:

90-100        A

80-89          B

70-79          C

60-69          D

Below 60     F

In: Computer Science

What is a VOID function? How do local and global variables differ? Explain how the value-return...

What is a VOID function? How do local and global variables differ? Explain how the value-return function works.

In: Computer Science

Written in C++ Define a class for a type called Fraction. This class is used to...

Written in C++

  • Define a class for a type called Fraction. This class is used to represent a ratio of two integers. Include mutator functions that allow the user to set the numerator and denominator.

  • Also include a member function that returns the values of the numerator divided by the denominator as a double.

  • Include an additional member function that outputs the value of the fraction reduced to lowest terms. This will require finding the greatest common divisor for the numerator and denominator, and dividing by that number.

In: Computer Science

An expert system developer lost a court case about a newly deployed system. The general issue...

  1. An expert system developer lost a court case about a newly deployed system. The general issue was based on the fact that the new system could not be differentiated from the old systems even though the new system functioned normally. In ten points, explain the specific issues about the system that the developer likely failed to present at the compiling stage.

In: Computer Science

Which one of the following expressions evaluates to True? Select one: 5 > 1 and 1...

Which one of the following expressions evaluates to True?

Select one:

5 > 1 and 1 == 5

5 > 9 or 2 < 0 or not 42 > 1

not 8 < 5 and not 10 == 3

not (15 == 15 or 15 < 0)

36 == 35 or 35 > 2 and 35 < 0

In: Computer Science

. Write a program to print * in the following order using 2d array in java...

. Write a program to print * in the following order using 2d array in java

                                             *             *             *             *             *

                                             *             *             *             *

                                             *             *             *

                                             *             *            

                                             *

In: Computer Science

For this C++ program, Write and modify the code to compute and display the class average...

For this C++ program, Write and modify the code to compute and display the class average as well as the standard deviation. Your code changes are as follows:

1. The variable “double grade” should be replaced by a two-dimensional array variable “double grade[NUMSTUDENTS][NUMGRADES].” Also replace the variable “double average” by “double average[NUMSTUDENTS].” This is necessary since you need to save the entered grades specially to compute the standard deviations.

2. After completing the display of the average grade of all students, your program should compute the class average (i.e., the average of four students’ average grades) and display.

3. Determine and display the class standard deviation by subtracting the class average from each student’s average grade (that results in a set of new numbers, each called a deviation); squaring each deviation; adding the squared deviations; dividing the sum by the number of students, NUMSTUDENTS; and taking its square root.

#include <iostream>

using namespace std;

int main()

{

const int NUMGRADES = 3;

const int NUMSTUDENTS = 4;

int i,j;

double grade, total, average;

for (i = 0; i < NUMSTUDENTS; i++) // start of outer loop

{

    total = 0;                       // clear the total for this student

    for (j = 0; j < NUMGRADES; j++) // start of inner loop

    {

      cout << "Enter an examination grade for this student: ";

      cin >> grade;

      total += grade;               // add the grade into the total

    }                                // end of the inner for loop

    average = total / NUMGRADES;     // calculate the average

    cout << "\nThe average for student " << i

      << " is " << average << "\n\n";

}                                  // end of the outer for loop

return 0;

}

In: Computer Science

• Define and describe SaaS. • List the advantages and disadvantages of SaaS solutions. • Define...

• Define and describe SaaS.

• List the advantages and disadvantages of SaaS solutions.

• Define and describe OpenSaaS.

• Define and describe mashups.

• Discuss the wide range of SaaS solutions and their providers.

In: Computer Science

In the RSA public-key encryption scheme, each user has a public key, e, and a private...

In the RSA public-key encryption scheme, each user has a public key, e, and a private key, d. Suppose Alice leaks her private key. Rather than generating a new modulus, she decides to generate a new public key and a new private key. Is this safe? why or why not?

In: Computer Science