Questions
NOTE: This is done using Visual Basic. Create an application named You Do It 2. Add...

NOTE: This is done using Visual Basic.

Create an application named You Do It 2. Add a text box, a label, and a button to the form. Enter the following three Option statements above the Public Class clause in the Code Editor window: Option Explicit On, Option Strict Off, and Option Infer Off. In the button’s Click event procedure, declare a Double variable named dblNum. Use an assignment statement to assign the contents of the text box to the Double variable. Then, use an assignment statement to assign the contents of the Double variable to the label. Save the solution and then start and test the application. Stop the application. Finally, change the Option Strict Off statement to Option Strict On and then use what you learned in this Focus lesson to make the necessary modifications to the code. Save the solution and then start and test the application. Close the solution.

In: Computer Science

Learning binary and other numbering systems is an important skill for computer and software engineers. Write...

Learning binary and other numbering systems is an important skill for computer and software engineers. Write the following in decimal (base 10), binary, octal (base 8), and hexadecimal. Show your work by hand (don’t forget to scan your work and put it in your PDF).

Decimal 1, 10, 42, 255

Hexadecimal F, DF, 81, 04

Binary 10010011, 111111

In: Computer Science

NOTE: This is done using Visual Basic. Create an application named You Do It 1. Add...

NOTE: This is done using Visual Basic.

Create an application named You Do It 1. Add a text box, a label, and a button to the form. The button’s Click event procedure should store the contents of the text box in a Double variable named dblCost. It then should display the variable’s contents in the label. Enter the three Option statements above the Public Class clause in the Code Editor window, and then code the procedure. Save the solution and then start and test the application. Close the solution.

In: Computer Science

Write a program in java which has two arrays of size 4 and 5; merge them...

Write a program in java which has two arrays of size 4 and 5; merge them and sort.

In: Computer Science

The CIA triad is widely referenced in today's information security environments as a basic model for...

The CIA triad is widely referenced in today's information security environments as a basic model for information security. There are three distinct legs to the CIA triad: confidentiality, integrity, and availability. Select one of the CIA components and expand on it. Include a baseline review of that specific attribute as well as challenges that might be encountered, including two potential security issues.

Respond to the following in a minimum of 175 words:

In: Computer Science

** Only bold needs to be answered In Java, implement the Athlete, Swimmer, Runner, and AthleteRoster...

** Only bold needs to be answered

In Java, implement the Athlete, Swimmer, Runner, and AthleteRoster classes below. Each class must be in separate file. Draw an UML diagram with the inheritance relationship of the classes.

1. The Athlete class
a. All class variables of the Athlete class must be private.

b.is a class with a single constructor: Athlete(String lName, String fName, int birthYear, int birthMonth, int birthDay, char gender). All arguments of the constructor should be stored as class variables. There should only be getter methods for first and last name variables. There should be no getters or setters for birthYear, birthMonth, birthDay.

c. Getter and setter methods for the gender of the athlete. The method setGender accepts a character and store it as a class variable. Characters 'm', 'M' denotes male, 'f' or 'F' denotes male or female. Any other char will be treated as undeclared. The method getGender return either the word "male" or "female" or “undeclared”.

  1. The method computeAge() takes no arguments and returns the athletes computed age (as of today's date) as a string of the form "X years, Y months and Z days". Hint: Use the LocalDate and Period classes.

    i. e.g. "21 years, 2 months and 3 days". ii. e.g. "21 years and 3 days".

    iii. e.g. "21 years and 2 months". iv. e.g. "21 years".

    v. e.g. "2 months and 3 days".

  2. The method public long daysSinceBirth() takes no arguments and returns a long which is the number of days since the athlete’s date of birth to the current day. Hint: Use the LocalDate and ChronoUnit classes.

  3. The toString method returns a string comprised of the results ofgetFname, getLName and computeAge. E.g.

    i. “Bunny Bugs is 19 years and 1 day old”

  4. The equals method returns true if the name and date of birth of this athlete and the compared other athlete are the same, otherwise return false.

2. The Swimmer class
a. All class variables of the Swimmer class must be private.

  1. inherits from the Athlete class and has a single constructor,

    Swimmer(String lName, String fName, int birthYear, int birthMonth, int birthDay, char gender, String team). There should be a class variable for team. There should be a getter method for team.

  2. The Swimmer class stores swim events for the swimmer. There should be a class variable for events. A swimmer participates in one or more of these events. The addEvent method is oveloadedand either adds a single event for the swimmer public boolean addEvent(String singleEvent) or adds a group of events for the swimmer public boolean addEvent(ArrayList multiEvents). Each event is of type String. Duplicate events are not stored and return false if duplicate found.

  3. There should be a getter method that returns the class variable events.

  4. The overridden toString method returns a string comprised of the concatenation of the parent’s toString return plus " and is a swimmer for team: XXXXX in the following events: YYYYY; ZZZZZZ." E.g.

    i. “Missy Franklin is 24 years and 4 months old and is a swimmer for team: Colorado Stars. She participates in the following events: [100m freestyle, 100m backstroke, 50m backstroke]”

3. The Runner class
a. All class variables of the Runner class must be private.

  1. inherits from the Athlete class and has a single constructor,

    Runner(String lName, String fName, int birthYear, int birthMonth, int birthDay, char gender, String country). There should be a class variable for country. There should be a getter method for country.

  2. The Runner class stores race events for the runner. There should be a class variable for events. Each event is a Distance. The list of valid events is given below:
    M100, M200, M400, M3000, M5000, M10000. A runner participates inone or more of these events. The addEvent method is oveloadedand either adds a single event for the runner public boolean addEvent(String singleEvent) or adds a group of events for the runner public boolean addEvent(ArrayList multiEvents). Each event is of type String. Duplicate events are not stored and return false if duplicate found.

  1. There should be a getter method that returns the class variable events.

  2. The toString method returns a String in the form: " AAA BBBB is XX years, YY months and ZZ days. He is a citizen of CCCCCCC and is a DDDDDDDD who participates in these events: [MJ00, MK00, ML00]”. If she does not participate in M3000 or M5000 or M10000 then she is a sprinter. If she does not participate in M100 or M200 or M400 then she is a long-distance runner. Otherwise she is a super athlete. E.g.

    i. “Bunny Bugs is 19 years and 1 day old. His is a citizen of USA and is a long-distance runner who participates in these events: [M10000]”

4. The AthleteRoster class
a. All class variables of the AthleteRoster class must be private.

  1. Does not inherits from the Athlete class. The AthleteRoster class has a single constructor, AthleteRoster(String semster, int year). There should be class variables for semester and year. There should be getter methods for semester and year.

  2. The AthleteRoster class has only one method for adding Athlete to the roster, by using the boolean addAthlete(Athlete a)method. The method returns true if the athlete was added successfully, it returns false if the athlete object already exists in the roster and therefore was not added.

  3. Your AthleteRoster class will have only one class level data structure, an ArrayList, for storing athlete objects.

  4. The String allAthletesOrderedByLastName() method returns a string object with of all the names of the athletes (Swimmers, Runners, etc.) in ascending order of last names(a-z).

  5. The String allAthletesOrderedByAge() method returns a string object with of all the names of the athletes (Swimmers, Runners, etc.) in descending order of age(100-0).

  6. The String allRunnersOrderedByNumberOfEvents() method returns a string object with of all the names of the Runners only in ascending order of number of events they participate in (0-100).

Complete the code before the due date. Submission of the completed eclipse project is via github link posted on the class page. Add your UML drawing to the github repo. ________________________________________________________________________ Example output:

__________Example from AthleteDriver shown below

Gender is undeclared
Gender is female
Gender is male
ComputeAge method says 19 years and 4 days
First name is : Duck

DaysSinceBirth method says 6943 days Last name is : Daffy
Output of our toString correct?:
Duck Daffy is 19 years and 4 days old =======================================

Did we add M10000 successfully?: true
Did we unsuccessfully try to add M10000 again?: false
Did we successfully add multiple events?: true
Did we unsuccessfully try to add multiple events?: false
How many events does Bugs participate in?: 3
Gender is male
Output of our toString correct?:
Bunny Bugs is 19 years and 3 days old. His is a citizen of USA and is a super athlete who participates in these events: [M10000, M100, M3000] =======================================

In: Computer Science

Question 1: Suppose we wish to transmit at a rate of 64kbps over a 3 kHz...

Question 1:

Suppose we wish to transmit at a rate of 64kbps over a 3 kHz telephone channel. What is the

minimum SNR required to accomplish this?

Question 2:

a) What is differential encoding?
b) Define biphase encoding and describe two biphase encoding techniques.

In: Computer Science

More Object Concepts (Exercise 4) Part A: Open the file BloodData.java that includes fields that hold...

More Object Concepts (Exercise 4)

Part A:

Open the file BloodData.java that includes fields that hold a blood type (the four blood types are O, A, B, and AB) and an Rh factor (the factors are + and –). Create a default constructor that sets the fields to “O” and “+”, and an overloaded constructor that requires values for both fields. Include get and set methods for each field. Open the file TestBloodData.java and click the Run button to demonstrate that each method works correctly.

Part B:

Open the file Patient.java which includes an ID number, age, and BloodData. Provide a default constructor that sets the ID number to “0”, the age to 0, and the BloodData to “O” and “+”. Create an overloaded constructor that provides values for each field. Also provide get methods for each field. Open TestPatient.java. Click the Run button at the bottom of your screen to demonstrate that each method works correctly.

BloodData.java

public class BloodData
{
public String bType;
public String rh;
public BloodData()
{
bType = "O";
rh = "+";
}
public BloodData(String bType, String rh)
{
this.bType = bType;
this.rh = rh;
}
public void setBloodType(String bType)
{
this.bType = bType;
}
public String getBloodType()
{
return bType;
}
public void setRhFactor(String rh)
{
this.rh = rh;
}
public String getRhFactor()
{
return rh;
}
}

Patient.java

public class Patient
{
// declare private variables here
public Patient()
{
// add default constructor values here
}
public Patient(String id, int age, String bType, String rhFactor)
{
// add constructor logic here
}
public String getId()
{
// write method code here
}
public void setId(String id)
{
// write method code here
}
public int getAge()
{
// write method code here
}
public void setAge(int age)
{
// write method code here
}
public BloodData getBloodData()
{
// write method code here
}
public void setBloodData(BloodData b)
{
// write method code here
}
}

TestBloodData.java

public class TestBloodData
{
public static void main(String[] args)
{
BloodData b1 = new BloodData();
BloodData b2 = new BloodData("A", "-");
display(b1);
display(b2);
b1.setBloodType("AB");
b1.setRhFactor("-");
display(b1);
}
public static void display(BloodData b)
{
System.out.println("The blood is type " + b.getBloodType() + b.getRhFactor());
}
}

TestPatient.java

public class TestPatient
{
public static void main(String[] args)
{
Patient p1 = new Patient();
Patient p2 = new Patient("1234", 35, "B", "+");
BloodData b2 = new BloodData("A", "-");
display(p1);
display(p2);
p1.setId("3456");
p1.setAge(42);
BloodData b = new BloodData("AB", "-");
p1.setBloodData(b);
display(p1);
}
public static void display(Patient p)
{
BloodData bt = p.getBloodData();
System.out.println("Patient #" + p.getId() + " age: " + + p.getAge() +
"\n The blood is type " + bt.getBloodType() + bt.getRhFactor());
}

}

In: Computer Science

Implement a method that does the following: (a) Create a Map data structure to hold the...

Implement a method that does the following:
(a) Create a Map data structure to hold the associations between player name (key) and team affiliation (value)

(b) Add at least 5 mappings to the map

(c) Print out the current roster of mappings

(d) Assuming some time has passed, change some of the mappings to simulate the players changing their affiliations

(e) Again, print out the current roster of mappings
3. Implement a main method that calls the above methods, demonstrating their use with all applicable printed output

In: Computer Science

Python Create a Python script file called hw3.py. Ex. 1. Write a program that inputs numbers...

Python

Create a Python script file called hw3.py.

Ex. 1. Write a program that inputs numbers from the user until they enter a 0 and computes the product of all these numbers and outputs it.

Hint: use the example from the slides where we compute the sum of a list of numbers, but initialize the variable holding the product to 1 instead of 0.

print("Enter n")
n = int(input())
min = n
while  n != 0:
    if n < min:
        min = n
    print("Enter n")
    n = int(input())
print("The minimum of the list is", min)

In: Computer Science

Visual Basic Your first job is to create a visual basic project that will display the...

Visual Basic

Your first job is to create a visual basic project that will display the name and telephone number for the contact person for the customer relations, marketing, order processing, and shipping departments. Include a button for each department. When the user clicks on the button for a department the program(in code for specific button will display the name and telephone number for the contact person in two labels. The same two labels will be used for each department Also include identifying labels with text "Department Contact'' and "Telephone Number". Be sure to include a button for Exit. Include a label at the bottom of the form that holds your name. Department Department Telephone Contact Custom relations Tricia Mills 500-1111• Marketing Michelle Rigner 500-2222 Order Processing Kenna DeVoes 500-3333 Shipping Eric Martin 500-4444

In: Computer Science

Can I get this logic in Python? plus what software I can use it to run?...

Can I get this logic in Python? plus what software I can use it to run?

thanks and will rate!!!

Search Lab

implement the following logic in Python, use appropriate data types. Data types are represented as either numeric (num) or string.

string name

string address

num item

num quantity

num price

num SIZE = 6

num VALID_ITEM [SIZE] = 106, 108, 307, 405, 457, 688

num VALID_ITEM_PRICE [SIZE] = 0.59, 0.99, 4.50, 15.99, 17.50, 39.00

num sub

string foundIt = “N”

string MSG_YES = “Item available”

string MSG_NO = “Item not found”

get name, address, item, quantity

sub = 0

while sub <= SIZE

if item == VALID_ITEM [sub] then

foundIt = “Y”

price = VALID_ITEM_PRICE [sub]

endif

sub = sub + 1

endwhile

if foundIt == “Y” then

print MSG_YES

print quantity, “ at “ , price, “ each”

print “Total “, quantity * price

else

print MSG_NO

endif

In: Computer Science

White the class Trace with a copy constructor and an assignment operator, printing a short message...

  1. White the class Trace with a copy constructor and an assignment operator, printing a short message in each. Use this class to demonstrate

    1. the difference between initialization

Trace t("abc");

Trace u = t;

and assignment.

Trace t("abc");

Trace u("xyz");

u = t;

  1. the fact that all constructed objects are automatically destroyed.

  2. the fact that the copy constructor is invoked if an object is passed by value to a

function.

  1. the fact that the copy constructor is not invoked when a parameter is passed

by reference.

  1. the fact that the copy constructor is used to copy a return value to the caller.

Programming language: C++

Requirement: please cover points 1-5.

In: Computer Science

IN JAVA A recursive method that takes a String as its argument and returns a list...

IN JAVA

  • A recursive method that takes a String as its argument and returns a list of Strings which includes all anagrams of the String. This method will contain a loop that generates each possible substring consisting of all but one character in the input String, ie the substring that omits the first letter, then the substring that omits the second letter, etc. Within the loop, the method calls itself recursively for each substring. For each String in the list returned by the recursive call, add the omitted character back to the end and add the String to the list to be returned. When the first instance of this method returns, the list will contain all anagrams of the original input String. It may help to work this out with a pencil and paper for a very short string (like "abc".) The most straightforward base case (termination condition for the recursion) is to return a list containing only a new empty String if the input String has length 0. If you want a challenge, try replacing this algorithm with one that uses the only recursion, with no loops.
  • A nonrecursive method that starts the recursion for the filtering step. This method will take a list of Strings, consisting of the anagrams, as its argument. Use a loop that takes each String in the list, converts it to an array of Strings using String's split() method with a blank space as the argument, and then uses the array to provide values for a list of Strings. The result of this will be a list of Strings in which each String is a word from the anagram. Still, inside the loop, call the recursive filter method for each of these Strings. In each case when it receives a non-null String as the return value fo the recursive filter method, it will add the String to the list which it returns.
  • A recursive filter method that takes a list of Strings and returns the following:
    • if all of the Strings in the list are contained in the list of valid words, return a single String made up of the Strings in the order in which they appear in the list
    • if any of the Strings in the list do not appear in the list of valid words, return null. This should be much more common than the first case.

If a list is received for which the last String is in the word list, this method should recursively call itself on a list consisting of all but the last word. If the recursive call returns a String (not null), add the last word back to the end of the String and return it. This method should not contain any loops.

In: Computer Science

100 bacteria cells are inoculated into a medium containing sufficient nutrients. Assuming it takes extactly one...

100 bacteria cells are inoculated into a medium containing sufficient nutrients. Assuming it takes extactly one hour for any cell to divide. Write a program to calculate how many hours it takes for this cell population to reach a million cells. Use python please and get exact time value for 1,000,000 cells in while or if statement

In: Computer Science