Questions
Computer Networks A client-server system uses a satellite network, with the satellite at a height of...

Computer Networks

A client-server system uses a satellite network, with the satellite at a height of 20,000 km. What is the best-case delay in response to a request?

In: Computer Science

having trouble with loop, when I added saving and loading to my code, when adding new...

having trouble with loop, when I added saving and loading to my code, when adding new player, it continues to ask for new player

class TeamClass:
    name = ""
    jersey = ""
    number = ""

    def __init__(self, name, jersey, number):
        self.name = name
        self.number = number
        self.jersey = jersey

    def set_name(self, name):
        self.name = name

    def set_jersey(self, jersey):
        self.jersey = jersey

    def set_number(self, number):
        self.number = number

    def get_name(self, name):
        return self.name

    def get_jersey(self, jersey):
        return self.jersey

    def get_number(self, number):
        return self.number

    def display_team_roster(self):
        print("Player")
        print("Name: ", self.name)
        print("Jersey: ", self.jersey)
        print("Phone Number: ", self.number)
        print("-------------")


def menu():
    print("-----Roster Menu----")
    print("1. Display Team Roster")
    print('2. New Player')
    print("3. Remove player")
    print("4. Edit Player")
    print("5. Save Roster Menu")
    print("6. Load Roster Menu")
    print("7. Exit Roster Menu")
    print("")
    selection = int(input("Enter an option or 7 to exit: "))
    return selection


def display_roster(roster):
    if len(roster) > 0:
        for x in roster.keys():
            roster[x].display_team_roster()
    else:
        print("Roster is empty")


def add_member(roster):
    new_member = input("Enter new Player: ")
    new_jersey = input("Enter jersey#: ")
    new_number = input("Enter phone number: ")
    roster[new_member] = TeamClass(new_member, new_jersey, new_number)


def del_member(roster):
    del_member = input("Which player would you like to remove?: ")
    if del_member in roster:
        del roster[del_member]
        print(del_member, "has been removed")
    else:
        print(del_member, "was not found")
    return roster


def edit_member(roster):
    existing_member = input("Which player would you like to edit? ")
    if existing_member in roster:
        new_member = input("Enter new players name: ")
        new_jersey = input("Enter new jersey#: ")
        new_number = input("Enter new phone number: ")
        roster[existing_member] = TeamClass(new_member, new_jersey, new_number)
        print(existing_member, "has been changed to", new_jersey, new_number)
    else:
        print(existing_member, "was not found")
    return roster


def save_member(roster):
    filename = input("week1.py\teamroster.txt:")
    print("Saving Roster")
    outfile = open(teamroster.txt,"wt")
    for x in roster.keys():
        name = roster[x].get_name()
        jersey = roster[x].get_jersey()
        number = roster[x].get_number()
        outfile.write(name+", "+jersey+", "+number+"\n")
    print("Roster saved")
    outfile.close()


def load_member():
    roster = {}
    filename = input("week1.py\teamroster.txt:")
    inFile = open(teamroster.txt,"rt")
    print("Loading Roster ")
    while True:
        inLine = inFile.readline()
        if not inLine:
            break
        inLine = inLine[:-1]
        name, jersey, number = inLine.split(",")
        roster[name] = TeamClass(name,jersey,number)
    print("Data Loaded Successfully.")
    inFile.close()
    return roster


print("")
roster = {}
menu_selection = menu()

while menu_selection != 7:
    if menu_selection == 1:
        display_roster(roster)
    elif menu_selection == 2:
        add_member(roster)
    elif menu_selection == 3:
        roster = del_member(roster)
    elif menu_selection == 4:
        roster = edit_member(roster)
    elif menu_selection == 5:
        roster = save_member(roster)
    elif menu_selection == 6:
        roster = load_member(roster)
menu_selection = menu()
print("Good Bye")

  

In: Computer Science

Write a C++ program where class 1 and class 2 (which is a base class) should...

Write a C++ program where class 1 and class 2 (which is a base class) should have a derived class (class 4 and class 5). Each of the derived classes should include at least 1 variable, 2 functions (one will be showing the function overriding case, the second one will be showing the function overloading case), 2 constructors (with default values, with parameters).

Then class 3 (composition) (to relate class 1 and class 2) should include 3 variables (first variable is an object belongs to class 1, second variable is an object belongs to class 2,third variable is class 3 own variable), 3 functions.

In: Computer Science

Write a program to calculate the amount of money in an account: The user will input...

Write a program to calculate the amount of money in an account:

The user will input initial deposit and the number of years to leave that money in the account.

The interest is constant at 0.5% for the entire length of time.

The output will be the balance, with interest compounded annually.

(simple interest formula: interest = principal * rate)

  1. What variables will you need to complete the program?





  2. What “controls” will you need for the program?






  3. What formula will you use? (give to you already!)







  4. Make the program user friendly!! (ideas for that?)

In: Computer Science

What is the Cyber Security Enhancement Act? Provide some examples of court cases that involved violations...

What is the Cyber Security Enhancement Act? Provide some examples of court cases that involved violations of this act. What are some of the punishment(s) if someone is found guilty? (150+ words, no copy and paste from other sources please.)

In: Computer Science

Your software company was invited to provide a proposal for a company in Australia. You currently...

Your software company was invited to provide a proposal for a company in Australia. You currently have the cost in US dollars and need to convert the prices to the Australian dollar.

Write a 2-part program using Ruby, Java®, or Python.

Part 1: Write a function to gather the following costs from the user:

  • Travel Cost: $9,800
  • Hotel Cost: $3,500
  • Rental Car Cost: $1,600
  • Labor Cost: $15,500

Part 2: Write a function to convert the costs from United States dollar (USD) to Australian dollar (AUD). Note: Look up the current USD to AUD exchange rate to use in your function.

Test the program 3 times by providing different costs in USD.

In: Computer Science

Write a C++ program that outputs to a file, final marks and average mark for a...

Write a C++ program that outputs to a file, final marks and average mark for a primary school class. Your program should also output to a second a file, the student names and their average mark in ascending order. This is an example of how your program in action could look like: Sample Input Please enter student name and student number Kgosi Kgosi 20150986 Please student marks for Setswana, Maths, Science, English, and Social Studies 80 70 80 65 100 Please enter any comments about the Student Sample Output First File *************************************Report************************************************* Student Name: Kgosi Kgosi Student Number: 20150986 Course Name Marks % Letter Grade Setswana 80 A - Maths 70 B Science 80 AEnglish 65 B - Social Studies 100 A+ Average: 79 Excellent Comments: **************************************************************************************************** Page 3 of 4 The program should also generate a second file listing all students and their average mark. The list of students should be arranged according to their marks in descending order. Sample Output Second File Kgosi Kgosi 79 Masego Ndi 59 Des Rinn 23

In: Computer Science

Discuss at least four factors that cause bugs and failures of computer systems. Include at least...

Discuss at least four factors that cause bugs and failures of computer systems. Include at least one that can be blamed on people and at least one that is inherent in the technology. For each of your four factors, tell which type of factor it is (blamed on humans or inherent in the technology). Include at least one example of each. Answer in 3 paragraphs. Like an essay

In: Computer Science

Linux always picks up the process from the highest priority queue that is not empty. How...

Linux always picks up the process from the highest priority queue that is not empty.

How does it prevent starvation of processes in the lower priority queues?

(Please help Operating system question, 6 points)

In: Computer Science

Find an article from the internet about Computer security and then write a summary of that...

Find an article from the internet about Computer security and then write a summary of that article. Include why you were interested in the article, what you learned from it, and how you could use it in your career as a cyber security professional. (minimum 1300 words)

In: Computer Science

The following methods are used: main(...), the encode(...) and the decode()....Is there any issue with one...

The following methods are used: main(...), the encode(...) and the decode()....Is there any issue with one of the method? If yes can you correct it.

You are requested to implement the same program without the two methods encode() and decode()...

Implement the code only with the main() and test your program again.

public class SCiphM {

    final static String key = "]kYV}(!7P$n5_0i R:?jOWtF/=-pe'AD&@r6%ZXs\"v*N"
            + "[#wSl9zq2^+g;LoB`aGh{3.HIu4fbK)mU8|dMET><,Qc\\C1yxJ";

    static String text = "Here we have to do is there will be a input/source "
            + "file in which we are going to Encrypt the file by replacing every "
            + "upper/lower case alphabets of the source file with another "
            + "predetermined upper/lower case alphabets or symbols and save "
            + "it into another output/encrypted file and then again convert "
            + "that output/encrypted file into original/decrypted file. This "
            + "type of Encryption/Decryption scheme is often called a "
            + "Substitution Cipher.";

    public static void main(String[] args) {
        String enc = encode(text);

        System.out.println("Encoded: " + enc);
        System.out.println("\nDecoded: " + decode(enc));
    }

    static String encode(String s) {
        String sb = new String(s);
        String r="";
        for (int i =0 ; i < sb.length(); i++) {
            r= r + key.charAt((int)sb.charAt(i) - 32);
           
        }

        return r;
    }
   
    static String decode(String s) {
        String sb1 = new String(s);
        String r1="";
       
        for (int i =0 ; i < sb1.length(); i++) {
            r1= r1 + key.charAt((int)sb1.charAt(i) + 32);
           
        }

        return r1;
    }
   

   
}

In: Computer Science

1. What are the strengths and weaknesses of using a Gantt chart for representing a project...

1. What are the strengths and weaknesses of using a Gantt chart for representing a project plan? How about a Network diagram and a PERT diagram? When they should be used ? Is one method “better” than the other? Should we combine them together?

Please No handwritten work.

In: Computer Science

Describe some advantages of using computer technology (e.g., smart cards, databases, etc.) for identification cards and...

Describe some advantages of using computer technology (e.g., smart cards, databases, etc.) for identification cards and identification systems, as compared to the current Social Security card and number system. Describe some serious potential risks or problems of using computerized ID cards/systems. Consider both private and governmental uses.

Answer in 3 paragraphs. Like an essay.

In: Computer Science

During the systems development life cycle (SDLC), certain key problems discovered in the later stages could...

During the systems development life cycle (SDLC), certain key problems discovered in the later stages could be directly traced back to inadequate and/or poor efforts in the requirements phase and industry studies show that over 50% of systems problems belong to this case. In addition, as mentioned in this week lecture notes "the cost of errors in requirements that weren’t discovered until later" may go up to 1,000 times. As a systems analyst, what should we do to minimize this problem? How might this be avoided?

Please no handwritten notes as those are hard to read.

In: Computer Science

Write a pseudo code program for a goal-based agent. The goal of the agent is to...

Write a pseudo code program for a goal-based agent. The goal of the agent is to find the exit of a labyrinth.

  • The agent is not omniscient
  • The agent can sense if it is next to a wall (in front, left or right)
  • The agent can turn 90 degrees to the right or left
  • The agent can drive 1unit forward

The maze is constructed of paths that are 1 unit across (wide)

Show a maze of your choosing and illustrate the path taken from start to exit according to your program (example shown here).

In: Computer Science