Complete this assignment in Python 3.x. Make sure you have downloaded the software, and it is installed correctly.

You will code the following and submit it in one file. Use the information in the Lessons area for this week to assist you. Save it as a python file (.py), and upload it into the Assignments area.

Create a comment block (starts at line 1 in the code) with the following information:

Your Name
Course Name, Section (example: ENTD200 B002 Spr15)
Instructor name
Week #
Date completed
Problem 1: Create a list (or tuple only, no dictionary) that contains the months of the year. ( do not hardcode the number)
Problem 2: Create a loop to print the number and the months of the year from the list.
The output should like this:

Month 1 is January
Month 2 is February
….
….

Month 12 is December

Optional 1

Month 1 is January, ...Happy new year ( Do not use if-then)

The output will look like this

Month 1 is January , ...Happy New Year!
Month 2 is February, ...Happy Valentine!
Month 3 is March
Month 4 is April
Month 5 is May
Month 6 is June
Month 7 is July, ...Happy Fourth of July!
Month 8 is August
Month 9 is September
Month 10 is October, ...Happy Halloween!
Month 11 is November, ...Happy Thanksgiving!
Month 12 is December, ...Merry Christmas!

Optional 2
Modify the Payroll and/or the MPG program from week5/6 to store the results in a list/dictionary. Print the list/dictionary when no more calculation is selected.
The output will be something like this for the payroll

Payroll for week xyz
James Bond ....... 21,500
Al Bundy ....... 500
Johnny English ….. 1,200
Total Payroll ....... 23,200

For the MPG will be something like

MPG for zyz truck
Week 1 ..... 12
Week 2 ..... 33
Week 3 ..... 27
MPG Ave ..... 24

Answers

Answer 1

Answer:

The program code is completed below

Explanation:

Program Code:

"""

  Your Name

  Course Name, Section (example: ENTD200 B002 Spr15)

  Instructor name

  Week #

  Date completed

"""

months = ["January ", "February", "March", "April", "May", "June", "July"

, "August", "September", "October", "November", "December"]

for i in range(0,12):

print("Month",i+1, "is" , months[i])


Related Questions

Suppose that you need to maintain a collection of data whose contents are fixed- i.e., you need to search for and retrieve existing items, but never need to add or delete items. Although the collection of data may be quite large, you may assume that it can fit in the computer's memory. Which of the following data structures is the most efficient one to use for this task?

a. a sorted array
b. a linked list
c. a binary search tree
d. a queue
e. they are all the same

Answers

Final answer:

A sorted array is the most efficient data structure for searching and retrieving existing items in a collection of fixed data.

Explanation:

The most efficient data structure to use for a collection of fixed data that needs efficient search and retrieval operations is a sorted array. A sorted array allows for fast search times using binary search, which has a time complexity of O(log n). This is because the elements in the array are sorted in a specific order, allowing for efficient comparisons.

In contrast, a linked list would require sequential traversal, resulting in a time complexity of O(n). A binary search tree can also provide efficient search times with a time complexity of O(log n), but it requires additional space for storing the tree structure.

A queue is not suitable for this task, as it is designed for adding and removing items, not for searching and retrieving existing items. Therefore, the most efficient data structure for this task is a sorted array.

A system administrator suspects that there is an error in the replication configuration. How can the system administrator look for specific error messages related to replication?
A. By using the Active Directory Sites and Services administrative tool
B. By using the Computer Management tool
C. By going to Event Viewer > System Log
D. By going to Event Viewer > Directory Service Log

Answers

Answer:

Option D i.e., By going to Event Viewer > Directory Service Log is the correct option.

Explanation:

The following option is not false because the admin of the system assumes that there is the occurrence of the particular error message related to the replication, the main reason behind this is that the administrator firstly go the Event Viewer then, he go to the Directory Service Log. After that, a particular error message appears in the replication configuration.

To use the mail merge feature in Access, the first step is to start the Microsoft Word Mail Merge Wizard.

a. True
b. False

Answers

Answer:

A) True

Explanation:

While working with MS Access, the mail merge feature allows us to quickly pickup records from the database tables and insert them on Microsoft word documents such as letters/envelops and name tags before printing them. The main advantage of a mail merge is the time saved as the process of creating several mailings for different individual letters/envelops is made simple.

The first step in creating a mail merge is starting the Microsoft Word Mail Merge Wizard in MS Access which will guide you in the entire steps, some of these steps include:

1. Selecting the document you wish to work with

2. Switching to MS Word

3. Selecting the the size of the envelope .

4. Selecting the  recipients records from the database table

5. Arranging and inserting records from the database (addresses on the envelope).

6. Review/Preview and Print

The Universal Containers customer support organization has implemented Knowledge Centered Support (KCS) in the call center. However, the call center management thinks that agents are not contributing new knowledge articles as often as they should. What should the company do to address this situation? ( Select 2 )

A. Require agents to check a box on case when submitting a new suggested article
B. Create a dashboard for articles submitted by agents & approved for publication
C. Measure & reward agents based on the # of new articles submitted for approval
D. Measure & reward agents based on the # of new articles approved for publication

Answers

Answer:

B. Create a dashboard for articles submitted by agents and approved for publication.

C. Measure & reward agents based on the # of new articles submitted for approval.

Explanation:

A data dashboard is a tool that manages, visually traces, displays and measures success in meeting performance objectives. In this scenario, creating a dashboard will keep track of submitted and approved publication. This helps agents to determine the quality of their articles. It guarantees that the correct procedures and methodology are being pursued for article creation. This will increase productivity of the company and saves time as the staff would not have to spend a lot of time in making reports in Excel. As a matter of fact when agents view their key measurements on dashboard, they will instinctively start improving and contributing new knowledge articles. Measuring and rewarding agents on the basis of new articles submitted for approval is a way to encourage and motivate the agents in order to make them make contributions. As a result of this motivation they will work harder. Giving rewards as encouragement will also attract new agents.

This assignment is to code a simple hangman game. The game should choose a random word out of a list of words that are coded into the program and ask for guesses. You should include a total of 20 words, lengths ranging from 4 to 12 letters long . Each time a person guesses wrong, it should decrement the total number of guesses (5 incorrect guesses allowed, on the 6th incorrect guess the game ends with a loss). When the user guesses the word or if they lose, they have the option of playing again. The expected output should be text based.

Answers

Answer:

Programming language not stated.

I'll use python for this question

Explanation:

import random

# library that we use in order to choose

# on random words from a list of words

words = ['rain, 'computer', 'science', 'program, 'python', 'mathematics', 'player', 'condition','reverse', 'water', 'board', 'geeks','learn','school','days','scholar','collar','flood','house','flies']

# Function will choose one random word from this list of words

word = random.choice(words)

print("Guess the word")

guesses = ''"

# 5 turns

turns = 5

while turns > 0:

# counts the number of times a user fails

failed = 0

# all characters from the input word taking one at a time.

for char in word:

# comparing that character with the character in guesses

if char in guesses:

print(char)

else:

print("_")

# for every failure 1 will be incremented in failure

failed += 1

if failed == 0:

# user will win the game if failure is 0 and 'You Win' will be given as output

print("You Win")

# this print the correct word

print("The word is: ", word)

break

# if user has input the wrong alphabet then it will ask user to enter another alphabet

guess = input("guess a character:")

# every input character will be stored in guesses

guesses += guess

# check input with the character in word

if guess not in word:

turns -= 1

# if the character doesn’t match the word then “Wrong” will be given as output

print("Wrong")

# this will print the number of turns left for the user

print("You have", + turns, 'more guesses')

if turns == 0:

print("You Loose")

Which two security measures must an engineer follow then implementing Layer 2 and Layer 3 network design?

A.Utilize the native VLAN only on trunk ports to reduce the risk of an Double-Tagged 802.1q VLAN hopping attack
B.Utilize an access list to prevent the use of ARP to modify entries to the table
C.Utilize DHCP snooping on a per VLAN basis an apply ip dhcp snooping untrusted on all ports
D.Utilize the ARP inspection feature to help prevent the misuse of gARPE.Utilize private VLANs an ensure that all ports are part of the isolated port group

Answers

Answer:

A. Utilize the native VLAN only on trunk ports to reduce the risk of a Double-Tagged 802 1q VLAN hopping attack

C. Utilize DHCP snooping on a per VLAN basis an apply IP DHCP snooping entrusted on all ports.

D. Utilize the ARP inspection feature to help prevent the misuse of garpe Utilize private VLANs an ensure that all ports are part of the isolated port group.

Explanation:

We must configure the native VLAN only on trunk ports because in this way we are not to receive fake VLAN, and can steal information.

We can use DHCP snooping to configure trusted ports and entrusted ports, in this case, the trusted port can accept trust messages, only with those messages we can connect with the server.

We could ask the MAC address with ARP inspections, MAC address is unique value for a physical hardware in the world.

Fill in the blanks:

a. __________ is based on travelling datagrams through internetworks one hop at a time. The entire route is unknown at the beginning of the journey.

b. __________ is group-based communication. It can be one-to-many or many-to-many distribution.

c. The most important requirement of a _______ network is the ability to treat different data types differently.

d. _______ process transmits telephone calls (voice) over the internet. 2

e. _______ is the standard recommended by the ITU for low bit-rate voice transmission over the Internet.

f. ________ is an unencrypted message data.

Answers

Answer:

(a). IP routing.

(b). Multicasting.

(c). converged.

(d). VoIP.

(e). VoIP.

(f). Plain text.

Explanation:

Ip routing is the method of transfer data from the one destination to another destination and it also send data from host to host across the network.

Multicasting is the type of distribution from one host to many hosts and also many hosts to many of them, it is used for the Internet Protocol Routing protocol in which the data is distributed to many receivers.

VoIP is that type of routing through which folks can use the internet services as the transmission mode.

Final answer:

Packet switching is based on travelling datagrams one hop at a time through internetworks. Multicast is group-based communication. A QoS network treats different data types differently.

Explanation:

a. **Packet switching** is based on travelling datagrams through internetworks one hop at a time. The entire route is unknown at the beginning of the journey.

b. **Multicast** is group-based communication. It can be one-to-many or many-to-many distribution.

c. The most important requirement of a **Quality of Service (QoS)** network is the ability to treat different data types differently.

d. **VoIP (Voice over IP)** process transmits telephone calls (voice) over the internet.

e. **G.729** is the standard recommended by the ITU for low bit-rate voice transmission over the Internet.

f. **Clear text** is an unencrypted message data.

1. True/False:
Mark either T (true) or F (false) for each statement in below. Write in one short sentence why you chose that answer, if necessary. You may lose points if your answer is very long.
a. Adjacency lists are more space efficient than adjacency matrices for sparse graphs. A sparse graph G = (V,E) has |E| = O(|V|).
b. The maximum number of edges in a graph with n vertices is n (n +1) / 2 .
c. A spanning tree of a graph with n vertices contains n edges.
d. Dijkstra’s algorithm does not work on directed graphs.
e. A dynamic programming algorithm makes short-sighted choices that are locally optimal.
f. Dynamic programming is an appropriate choice to solve merge sort.
g. Prim’s and Kruskal’s algorithms are examples of greedy algorithms.
h. In a flow network, the capacity of an edge must be less than or equal to the flow on the edge.
i. Dynamic programming uses memoization to avoid solving the same subproblem more than once.
j. Choice of data structures do not impact the time complexity of graph algorithms.

Answers

Answer:

(a) - True

(b)- False

(c)-  False

(d) - False

(e) - False

(f) - False

(g)- True

(h)-  False

(i) - False

(j) - False

Explanation:

(a)-  In an adjacency list the usage of space depends upon the number of edges and vertices in the graph while in the case of the matrix efficiency depends upon the square of the vertices.

(b) The maximum number of edges is n*(n-1).

(c) The number of edges with a spanning tree of n vertices contains n-1 edges.

(d) Dijkstra's Theorem simply refers the adjacent vertices of a vertex and is independent of the fact that a graph is directed or in directed.

(e)  Greedy Algorithm makes short sighted choices

(f) Consider the term overlapping sub-problems which is the technique used in Dynamic programming it uses previous calculations to find optimal solutions however in case of merge sort the idea is to break down array into smaller pieces that don't overlap unlike dynamic programming.

(g) Prim and Kruskal's algorithm are examples of greedy algorithm because the use the idea to pick the minimum weight edges at every step which is the approach of a greedy algorithm.

(h) the amount of flow on an edge cannot exceed its capacity.

(i) Dynamic Programming can be implemented using tabulation too.

(j) Different data structures have different time complexity.

Design and code a program including the following classes, as well as a client class to test all the methods coded:A Passenger class, encapsulating a passenger. A passenger has two attributes: a name, and a class of service, which will be 1 or 2.A Train class, encapsulating a train of passengers. A train of passengers has one attribute: a list of passengers, which must be represented with an ArrayList. Your constructor will build the list of passengers by reading data from a file called passengers.txt. You can assume that passengers.txt has the following format:...For instance, the file could contain:James 1Ben 2Suri 1Sarah 1Jane 2...You should include the following methods in your Train class:
a method returning the percentage of passengers traveling in first class
a method taking two parameters representing the price of traveling in first and second class and returning the total revenue for the train
a method checking if a certain person is on the train; if he/she is, the method returns true; otherwise, it returns false

Answers

Answer:

Code given below

Explanation:

/*

* Class to hold the Passenger data

* Stores the name and classOfService

* */

public class Passenger {

  String name;

int classOfService;

  public Passenger(String string, int classOfService) {

      this.name = string;

      this.classOfService = classOfService;

  }

@Override

  public String toString() {

      return "Passenger [name=" + name + ", classOfService=" + classOfService

              + "]";

  }

@Override

  public int hashCode() {

      final int prime = 31;

      int result = 1;

      result = prime * result + classOfService;

      result = prime * result + ((name == null) ? 0 : name.hashCode());

      return result;

  }

@Override

  public boolean equals(Object obj) {

      if (this == obj)

          return true;

      if (obj == null)

          return false;

      if (getClass() != obj.getClass())

          return false;

      Passenger other = (Passenger) obj;

      if (classOfService != other.classOfService)

          return false;

      if (name == null) {

          if (other.name != null)

              return false;

      } else if (!name.equals(other.name))

          return false;

      return true;

  }

  public String getName() {

      return name;

  }

  public int getClassOfService() {

      return classOfService;

  }

}

----

import java.util.ArrayList;

import java.util.List;

/* Train class for holding the

* passengerList.

* The passengerList is the list of Passenger Object

*/

public class Train {

  List<Passenger> passengerList;

  public Train() {

      passengerList = new ArrayList<Passenger>();

  }

  public Passenger getPassenger(int index) {

      if (index <= 0 && getTotalNumberOfPassengersOnBoard() < index) {

          return null;

      } else {

          return passengerList.get(index - 1);

      }

  }

  public void addPassenger(Passenger p) {

      passengerList.add(p);

  }

  public int getTotalNumberOfPassengersOnBoard() {

      return passengerList.size();

  }

  public boolean isPassengerOnBoard(String name) {

      boolean flag= false;

      for (Passenger p : passengerList) {

          if (p.getName().equalsIgnoreCase(name)) {

              flag = true;

              break;

          } else {

              flag = false;

          }

      }

      return flag;

  }

public double getRevenue(double priceFirstClass, double priceSecondClass) {

      double total = 0.0;

      for (Passenger p : passengerList) {

          if (p.getClassOfService() == 1) {

              total += priceFirstClass;

          } else {

              total += priceSecondClass;

          }

      }

      return total;

  }

  public double getPercentageFirstClassTravellers() {

      double count = 0.0;

      for (Passenger p : passengerList) {

          if (p.getClassOfService() == 1) {

              count++;

          }

      }

      return count / getTotalNumberOfPassengersOnBoard() * 100;

  }

@Override

  public String toString() {

      return "Train [passengerList=" + passengerList + "]";

  }

@Override

  public int hashCode() {

      final int prime = 31;

      int result = 1;

      result = prime * result

              + ((passengerList == null) ? 0 : passengerList.hashCode());

      return result;

  }

@Override

  public boolean equals(Object obj) {

      if (this == obj)

          return true;

      if (obj == null)

          return false;

      if (getClass() != obj.getClass())

          return false;

      Train other = (Train) obj;

      if (passengerList == null) {

          if (other.passengerList != null)

              return false;

      } else if (!passengerList.equals(other.passengerList))

          return false;

      return true;

  }

}

-----------

public class TrainTest {

  public static void main(String[] args) {

      Train t = new Train();

      Passenger p1 = new Passenger("James", 1);

      Passenger p2 = new Passenger("Sarah", 2);

      Passenger p3 = new Passenger("Jhon", 1);

      Passenger p4 = new Passenger("Test", 2);

      // add other passengers Test1 .. Test6

      for (int j = 1; j < 7; j++) {

          t.addPassenger(new Passenger("Test" + j, j % 2));

      }

      t.addPassenger(p1);

      t.addPassenger(p2);

      t.addPassenger(p3);

      t.addPassenger(p4);

      System.out.println("total revenue $" + t.getRevenue(10.0, 25.0));

      System.out.println("total number of passengers on Board .. "

              + t.getTotalNumberOfPassengersOnBoard());

      System.out.println("percentage of first class traveller .. "

              + t.getPercentageFirstClassTravellers());

      System.out.println("getPassenger number # 2 .. " + t.getPassenger(2));

      System.out.println("is passenger Jhon on board ? "

              + t.isPassengerOnBoard("Jhon"));

      System.out.println("is passenger Dummy on board ? "

              + t.isPassengerOnBoard("Dummy"));

      System.out.println("Printing all the Passengers on Board ...");

      for (int i = 1; i <= t.getTotalNumberOfPassengersOnBoard(); i++) {

          System.out.println("" + t.getPassenger(i));

      }

     

      // using the the Train toString to print all the passengers from Train

      System.out.println(t.toString());

  }

}

Consider the following class definition.public class Rectangle{private double length;private double width;public Rectangle(){length = 0;width = 0;}public Rectangle(double l, double w){length = l;width = w;}public void set(double l, double w){length = l;width = w;}public void print(){System.out.println(length + " " + width);}public double area(){return length * width;}public void perimeter(){return 2 length + 2 width;}}Suppose that you have the following declaration.Rectangle bigRect = new Rectangle();
Which of the following sets of statements are valid in Java?
(i) bigRect.set(10, 5);
(ii) bigRect.length = 10;bigRect.width = 5;

Answers

Answer:

The answer is "Option (i)".

Explanation:

In the given java code a class is defined that name is "Rectangle" inside a class two global private double datatype variable is defined that is "length and width". A default constructor is defined that contains the value of private variables. In the next line, a parameterized constructor and a set function is defined that contain the parameter values. Then three function is defined that is "print, area, and perimeter" in which print function prints value and area, perimeter function calculate values.

Option (i) is correct because it is the correct way to call the function. Option (ii) is incorrect because the private member does not accessible outside the class.

Write a function named wordLineCount with the following input and output: Input: a string parameter, inFile, that is the name of a file Output: return a dictionary in which each unique word in inFile is a key and the corresponding value is the number of lines on which that word occurs The file inFile contains only lower case letters and white space. For example, if the file ben.txt contains these lines tell me and i forget teach me and i remember involve me and i learn then the following would be correct output:

>>> print(wordLineCount('ben.txt')){'remember': 1, 'and': 3, 'tell': 1, 'me': 3, 'forget': 1, 'learn': 1,'involve': 1, 'i': 3, 'teach': 1}

Answers

Answer:

def wordLineCount(file):

   dic = {}

   with open(file,'r') as file:

       

       text = file.read()

       text = text.strip().split()

       for word in text:

           if word in dic:

               dic[word] += 1

           else:

               dic[word] = 1

   return dic

print(wordLineCount('ben.txt'))

Explanation:

The programming language used is python.

The program starts by defining the function, an empty dictionary is created to hold the words and the number of times that they occur. the with key word is used to open the file, this allows the file to close automatically as soon as the operation on it is finished.

The data in the file is read to a variable text, it is striped from all punctuation and converted to a list of words.

A FOR loop and an if statement is used to iterate through every word in the list and checking if they are already in the dictionary. if the word is already contained in the dictionary, the number of occurrences increases by one. otherwise, it is added to the dictionary.

check the attachment to see code in action.

A company purchased a high-quality color laser printer to print color brochures and sales proposals. The printer is connected to a marketing PC via USB and is configured as a shared local printer for use by the sales and marketing teams. The manager is concerned about the cost of consumables for the printer and does not want users to unintentionally print to the printer. What can be done to ensure that only authorized users can send print jobs to the printer?

Answers

Answer:

In order to ensure that only authorized users can send print jobs to the printer, the option of enabling the user authentication on shared printer can be used.

Explanation:

The manager can create user Id and password only for those people who have the permission to send the printer jobs to the printer. In this way, whenever a command is given to the printer, it will ask the user credentials before doing the printing job. If the person is unable to give the credentials then the printing will not start. Moreover, it will decrease the probability of the printing unintentionally so it will save the resources from wastage.

Which of the following is a best practice regarding the Administrator account?

A. This account should be used by the Administrator at all times, never his or her own account.
B. This account should be given a nondescript account name that cannot be easily guessed.
C. This account should be used only for low-level access to the network.
D. This account should be used only to run low-security applications.

Answers

Answer:

B. The account should be given a nondescript account name that cannot be easily guessed.

A penetration tester has been tasked with reconnaissance to determine which ports are open on the network. Which of the following tasks should be done FIRST? (Choose two)

A. Network scan
B. Banner grab
C. Tracert
D. DHCP server check
E. Brute-force attack

Answers

Network scan and banner grab are the following tasks should be done FIRST.

A. Network scan

B. Banner grab

Explanation:

The penetration tester has been assigned a task to determine which ports are open on the given network.

To kick start the process, the tester should give a network scan in order to gather information about the various elements of the network and their details.

To follow up, the tester should proceed with banner grab. Banner grabbing is the process through which he/she would gain information about a computer system on the network and services running on its open ports.

Which components can be added to a lightning app on custom object (choose 3 answers)A. Visualforce B. Standard Lightning component C. Custom lightning component D. global actions E. object specific actions on the custom object

Answers

Answer:

b. Standard Lightning component.

c. Custom Lightning component.

d. Global actions

These three components are best used in a ligthening app, for custom object i.e standard, Custom and Global Actions.

Adding Visualforce components to a Lightning Application is impossible, but one can add Lightning components into Visualforce pages.

Modify the function to return true if the given decimal is even when it is rounded to the nearest integer, and false otherwise 1 function isRoundedNumberEven(decimal) t 5 * Do not modify code below this line 6 7 console.log(İsRoundedNumberEven(2.2),'<-- console.logCisRoundedNumberEven(2.8), should should be be true'); false;

Answers

Answer:

The function solution is in JavaScript

Explanation:

function isRoundedNumberEven(decimal) {

   return Math.round(decimal) % 2 === 0;

/* the modulus 2 operation is used for numbers divisible by 2 */

/* This indicates even numbers */

}

console.log(isRoundedNumberEven(2.2));

console.log(isRoundedNumberEven(2.8));

A physical switch port is part of an EtherChannel group. What happens while the same port is configured as a SPAN destination?

A. The port forwards traffic in the EtherChannel group and acts as a SPAN source simultaneously
B. The operation is not allowed as an EtherChannel member cannot be a SPAN source port
C. The port is put in the errdisabled state and can only be reenabled manually
D. The port is removed from the EtherChannel group

Answers

Answer:

D. The port is removed from the EtherChannel group.

Explanation:

The configuration SPAN is when we copy traffic, and we transfer that traffic to another port, in this case, we can analyze that traffic in our benefit.

If a physical port belongs to the EtherChannel group, it can be configured as a SPAN source port and still be a part of the EtherChannel.

But a physical port cannot be configured as a SPAN destination and belong to the EtherChannel group.

This means we can be the SPAN source but not the SPAN destination.

create a new Java application called "CheckString" (without the quotation marks) according to the following guidelines.** Each method below, including main, should handle (catch) any Exceptions that are thrown. ** ** If an Exception is thrown and caught, print the Exception's message to the command line. **Write a complete Java method called checkWord that takes a String parameter called word, returns nothing, and is declared to throw an Exception of type Exception. In the method, check if the first character of the parameter is a letter. If it is not a letter, the method throws an Exception of type Exception with the message of: "This is not a word."Write a complete Java method called getWord that takes no parameters and returns a String. The method prompts the user for a word, and then calls the checkWord method you wrote in #1 above, passing as a parameter the word the user provided as input. Make sure the getWord method handles the Exception that may be thrown by checkWord.

Answers

Answer:

The Java code is given below

Explanation:

import java.io.*;

import java.util.Scanner;

import java.util.ArrayList;

public class StringCheck{

//There are several implementation approaches. This is one example framework/outline which might be helpful. Please feel free to try other approaches.

public static void checkWord(String word) throws Exception {

// Uses charAt method to test if the first letter of string variable word

// is a character. If not, throw new exception

if(Character.isLetter(word.charAt(0))){

 return;

}else{

 throw new Exception("This is not a word");

}

}

public static String getWord() {

// Declare a local scanner

// Prompt the user to enter a word

// Think about using a loop to give the user multiple opportunities to correctly enter a string

// Read into a string

// Call checkWord method passing the string as a parameter

// checkWord can throw an exception; call checkWord in a try/catch block

// Return the string to main if a valid string

Scanner sc = new Scanner(System.in);

boolean st = true;

String word = null;

while(st){

 System.out.println("Enter a Word : ");

 word = sc.next();

 try{

  checkWord(word);

  st = false;

 }catch(Exception e){

  System.out.println(e);

  st = true;

 }

}

sc.close();

return word;

}

public static void writeFile(String[] arrayToWrite, String filename) throws IOException {

// Example using FileWriter but PrintWriter could be used instead

// Create a FileWriter object

FileWriter fileWordStream = new FileWriter(filename);

// Use a loop to write string elements in arrayToWrite to fileWordStream

for(int i = 0;i<arrayToWrite.length;i++){

fileWordStream.write(arrayToWrite[i]+System.lineSeparator());

}

fileWordStream.flush();

fileWordStream.close();

// In the loop use the lineSeparator method to put each string on its own line

}

public static ArrayList readFile(String filename) throws FileNotFoundException, IOException {

// Declare local ArrayList

ArrayList<String> words = new ArrayList<>();

// Create a new File object using filename parameter

File file = new File(filename);

// Check if the file exists, if not throw a new exception

if(!file.exists()){

 throw new FileNotFoundException("File not Found");

}

// Create a new BufferedReader object      

Scanner fsc = new Scanner(file);

// use a loop and the readLine method to read each string (on its own line) from the file

while(fsc.hasNextLine()){

words.add(fsc.nextLine());

}

fsc.close();

// return the filled ArrayList to main

return words;

}

public static void main(String[] args) {

// create a string with literal values to write to the file

String[] testData = {"cat", "dog", "rabbit"};

// Create an ArrayList for reading the file

ArrayList<String> words = new ArrayList<>();

// Declare a string variable containing the file name "data.txt"

String file = "data.txt";

// Call getWord, assign the returned string to a variable and display it

String word = getWord();

System.out.println("The word is : "+word);

// Call writeFile and readFile methods in a try block

try{

writeFile(testData,file);

words = readFile(file);

// Printout the contents of the ArrayList after the call to readFile

for(int i = 0;i<words.size();i++){

 System.out.println(words.get(i));

}

}catch(FileNotFoundException e){

System.out.println(e);

}catch(IOException e){

System.out.println("IOException: error occured in input output");

}

// catch two types of exceptions

}

}

Final answer:

To create the 'CheckString' Java application, you need to write a method called 'checkWord' that throws an Exception if the word doesn't start with a letter, and another method called 'getWord' that prompts the user for input and handles any Exceptions thrown by 'checkWord'.

Explanation:

To create a new Java application called CheckString, you need to write two methods. The method checkWord will take a String parameter and throw an Exception if the word does not start with a letter. The method getWord will prompt the user for a word, call checkWord, and handle any Exceptions.



Method: checkWord

public void checkWord(String word) throws Exception {
  if (Character.isLetter(word.charAt(0)) == false) {
      throw new Exception("This is not a word.");
  }
  // otherwise, the input is considered a valid word
}



Method: getWord

public String getWord() {
  Scanner scanner = new Scanner(System.in);
  while (true) {
      try {
          System.out.print("Enter a word: ");
          String word = scanner.nextLine();
          checkWord(word);
          return word;
      } catch (Exception e) {
          System.out.println(e.getMessage());
      }
  }
}

Discuss in 500 words, why institutions might be reluctant to move there IT to the cloud. Consider specific industries like education, medicine, military, etc.

Answers

Answer:

1. Performance and uptime: In mission critical IT systems like those in the military performance and uptime are so important that the institutions might be reluctant to surrender their local infrastructure for cloud based systems, even if the cloud systems advertise better performance than what the institution's deployment can boast of. Even many corporates are still worried about this aspect of cloud computing. It’s no secret that a fraction of a second on load time can lead to loss of customers.

2. Security: Along with loss of control, security is arguably the biggest concern many large organizations like the military, academic institutions and hospitals have. Can other customers access our data? Have all the security patches been kept up to date? These question create a reluctance to migrate to the cloud among executives and IT directors in these institutions.

3. Data Protection: Closely tied in with security, institutions are concerned about data protection. Many governments place strict data protection requirements on large companies and standards audit schemes such as ISO-9001 place additional restrictions on firms.

For example, the UK’s Data Protection Act requires that personal data not to be transferred to any country outside the EU, unless that country “ensures an adequate level of protection for the rights and freedoms of data subjects in relation to the processing of personal data.” Practically, that means it’s often easier for servers to be physically located in the EU for many European institutions.

4. Losing control: When systems go down, it’s invariably the IT Director who takes the blame, so it’s no surprise that they are nervous about handing over responsibility for infrastructure to somebody they don’t even know.

Traditionally, if a hard drive fails or a CPU overheats, it’s the IT department who get the 3am call to fix it. It’s up to them to order the replacement hardware, power down the machine and get it back into production as soon as possible.

Even if you’re renting space in a hosting centre and paying for support, chances are you are physically allowed into the building and have the peace of mind that comes from knowing that, if all else fails, you can go in and fix the hardware yourself.

By moving to cloud computing, the IT Director or CIO can feel like they’re handing over control to a 3rd-party. What happens if one of the drives goes or there’s a networking issue? Who decides what hardware to buy?

Given variables first and last, each of which is associated with a str, representing a first and a last name, respectively. Write an expression whose value is a str that is a full name of the form "Last, First". So, if first were associated with "alan" and last with "turing", then your expression would be "Turing,Alan". (Note the capitalization! Note: no spaces!) And if first and last were "Florean" and "fortescue" respectively, then your expression's value would be "Fortescue,Florean".

Answers

Answer:

The python code is attached

Explanation:

I defined a function called FullnameThe function accepts 2 parameters first and lastlast[0] gives the first letter of the last variable last[0].upper() modifies the first letter as upper lettersame applied to variable first+ sign concatenates strings and variables to the variable namethe function returns the variable name

Final answer:

The answer provides a method for formatting first and last names into a specific string format "Last,First" with proper capitalization, using Python as an example. This involves string manipulation techniques including capitalization and concatenation.

Explanation:

The question is about creating an expression in a programming language to format names according to certain specifications. To achieve the result where a first and last name are transformed into a format "Last,First" with proper capitalization and no spaces in between, one can use a combination of string manipulation and formatting methods. For example, in Python, assuming first and last are your variables:

fullName = last.capitalize() + ',' + first.capitalize()

This line of code transforms both the first and last names to have their first letters capitalized using the capitalize() function. It then concatenates the last name with a comma, followed by the first name, creating a string in the desired format. This is a basic example that shows how to use string manipulation and formatting functions to format names correctly as per the given requirements.

1. Please write the following code in Python 3.2. Please also show all outputs.Create a dictionary named letter_counts that contains each letter and the number of times it occurs in string1. Challenge: Letters should not be counted separately as upper-case and lower-case. Intead, all of them should be counted as lower-case.string1 = "There is a tide in the affairs of men, Which taken at the flood, leads on to fortune. Omitted, all the voyage of their life is bound in shallows and in miseries. On such a full sea are we now afloat. And we must take the current when it serves, or lose our ventures."

Answers

Answer:

string1="There is a tide in the affairs of men, Which taken at the flood, leads on to fortune. Omitted, all the voyage of their life is bound in shallows and in miseries. On such a full sea are we now afloat. And we must take the current when it serves, or lose our ventures."

string1=string1.lower()   #covert whole string to lowercase

letter_counts={}

for ch in string1:

   letter_counts[ch]=letter_counts.get(ch,0)+1   #updates counter for each letter

letter_counts['o']

OUTPUT :

17

Explanation:

lower() is used to change the string to lowercase characters so that uppercase and lowercase is not differentiated for the same letter. After that, letter_counts is declared as a dictionary which is empty. for loop is used in which every letter of string will be stored ch variable. Dictionary in python has a get method in which 2 arguments can be passed, first one is the key whose value to be retrieved and the other argument would be default value to be set if not found and ch in string1 will increment the value of key ch in letter_counts.

What type of malicious software masquerades as legitimate software to entice the user to run it?

Answers

Answer:

Trojan horse

Explanation:

A Trojan horse is malicious software that masquerades as a legitimate computer program such as a video game, image file, utility program, or even an antivirus so as to entice the user to run it, thereby allowing an attackers (the developer of the malicious program) to gain access to the data on the computer in an illegal manner.

Problems with using a single Local Area Network (LAN) to interconnect devices on a premise include ______.

A. insufficient reliability, limited capacity, and inappropriate network interconnection devices
B. insufficient reliability, limited capacity, and limited distances
C. insufficient reliability, limited distances, and inappropriate network interconnection devices
D. limited distances, limited capacity, and inappropriate network interconnection devices

Answers

Answer:

A. insufficient reliability, limited capacity, and inappropriate network interconnection devices

Explanation:

LANs are unsecured and unreliable because they provide a way of another users to have access to others computers. They are also difficult to manage and access because the data they use is always shared between many different sources and this reduces the internet speed and limits the network capacity.

When admitting digital evidence at trial, the issue of ________ comes up when the evidence involves computer-generated records.

Answers

Answer:

When admitting digital evidence at trial, the issue of Authenticity comes up when the evidence involves computer-generated records.

Explanation:

The digital evidence such as video, audio or some pictures have been presented before court as evidence. The first question that may arise is related to "authenticity of the material". To authenticate that evidence court may order the forensic audit of that particular evidence.

So, the issue of authenticity of evidence will arise, in case of digital evidence.

Enter a formula in cell E4 to calculate how long each item has been on sale. This is calculated by subtracting the launch date in cell D4 from the Data Updated date in cell C20. To show the time in years, divide that result by 365. Use an absolute reference to the date in cell C20. Copy the formula from cell E4 to cells E5:E14.



In D4 is 3/17/2013


In C20 is 10/14/2016



Any help? I have no idea what function is needed for this.

Answers

Final answer:

In Excel, to calculate the time an item has been on sale, use the formula =($C$20-D4)/365 in cell E4 and copy it down to E5:E14. This formula subtracts the launch date from the Data Updated date and converts the result to years using an absolute reference for the Data Updated date.

Explanation:

To calculate how long each item has been on sale in an Excel spreadsheet, you would subtract the launch date in cell D4 from the Data Updated date in cell C20 and then divide by 365 to convert the difference to years. Since cell C20 should not change when you copy the formula, you need to use an absolute reference for this cell.

The formula in cell E4 will be =($C$20-D4)/365. This formula uses the absolute reference $C$20 to ensure that as you copy the formula from cell E4 to cells   E5:E14, the reference to C20 remains constant.

After entering the formula in E4, you would then copy it down to the cells E5 through E14. The result will show you the time each item has been on sale in years.

You just finished training a decision tree for spam classification, and it is gettingabnormally bad performance on both your training and test sets. You know that yourimplementation has no bugs, so what could be causing the problem?


(a) Your decision trees are too shallow.
(b) You need to increase the learning rate.
(c) You are overfitting.
(d) All of the above

Answers

Answer:

Option B is the correct option.

Explanation:

The following answer is true because when the person completed our training of a decision tree and after the following presentation he getting not good working performance on both side i.e., test sets and during the training period. After the training there is no bug on the implementation of the presentation then, he has to increase the rate of the learning.

The option that is causing the bad performance problem is that your decision trees are too shallow.

What is a decision tree?

A decision tree is known to be a kind of decision support tool that is often employed in a tree-like model of decisions and the consequences that follows these decision.

They include the likelihood of event outcomes, resource costs, and others. The reason why the individual is getting bad performance on both the training and test sets is that the decision trees are too shallow and as such one should widen the decision tree to get better result.

Learn more about decision tree from

https://brainly.com/question/26675617

PGP encryption can be performed from the command line as well. What is the PGP command line syntax to encrypt the my-message.txt file for a specific user (Sean) and save the output as secret-message.txt.gpg?

Answers

Answer:

pgp --encrypt "my-message.txt" --recipient (Sean) --output ("secret-message.txt.gpg")

Explanation:

PGP encryption from the command line can be done using the following format:

pgp --encrypt (input) --recipient (user) --output (output file)

Therefore, PGP command line syntax to encrypt the my-message.txt file for a specific user (Sean) and save the output as secret-message.txt.gpg is:

pgp --encrypt "my-message.txt" --recipient (Sean) --output ("secret-message.txt.gpg")
Final answer:

The PGP command line syntax for encrypting a file for a specific user and saving the output.

Explanation:

The PGP (Pretty Good Privacy) command line syntax for encrypting a file for a specific user and saving the output is as follows:

Open the command line interface (CLI) on your computer.Navigate to the directory where the my-message.txt file is located.Enter the following command:

gpg --recipient Sean --output secret-message.txt.gpg --encrypt my-message.txt

This command will encrypt the my-message.txt file using PGP for the user Sean and save the encrypted output as secret-message.txt.gpg.

Learn more about PGP Command Line Syntax here:

https://brainly.com/question/32149774

#SPJ3

Under the Health Insurance Portability and Accountability Act (HIPAA) Security Rule, what type of safeguards must be implemented by all covered entities, regardless of the circumstances?

a. Addressable
b. Standard
c. Security
d. Required

Answers

Answer:

D. Required

Explanation: The required safeguard must be implemented for all covered entities.

Person-name: String+setName(String name): void+getName(): String^Student-studentID: long+Student(String sname, long sid)+setID(): longWhich of these fields or methods are inherited (and accessible) by the Student class?
1. getName(), setName(), name
2. name, getName(), setName(), getID()
3. studentID, name, getName(), setName(), getID()
4. getName(), setName(), toString()
5. None of them
6. getName(), setName(), studentID, getID()

Answers

Answer and Explanation:

Basically its answer is option 4 where getName(), setName().to String()

let us explained it through  a program where get and set method has been used.

Create  Student class that has marks and grade. Two parameters initialize data member using constructors .Each data member gives values and member function .Show the values of data member.

You can code it in turbo and Dev C++ tool .

# include<iostream.h>

#include<conio.h>

class Student

{

private:

int marks;

String name;

char grade;

public:

Student ( int m , char g)  //get method where it get student marks and grade                                      

{ marks = m ;

grade = g;

}

public void set Name(String a) {

       name = a;

   }

 public String getName() {

       return name;

   }

void set()

{

cout <<"Marks = " <<marks <<endl;

cout<<"Name=" <<name<<endl;

cout <<"Grade = "<< grade <<endl;

}

};

void main ()

{

clrscr();

Student s1(730,'A','ali') s2(621,'B','haider')

cout <<"Recording of student 1 "<<endl;

s1.set();

cout <<"Recording of Student 2:"<<endl;

s2.set();

getch();        

}

for the above program you can see from

//{

cout <<"Marks = " <<marks <<endl;

cout<<"Name=" <<name<<endl;

cout <<"Grade = "<< grade <<endl;

}//

where name marks and grade are inherited from the class Student with get and set methods.But name is take into data type of string because string hold zero ,more letters , space and commas.So it is used to represent the text data.

Write a SELECT statement that returns an XML document that contains all of the invoices in the Invoices table that have more than one line item. This document should include one element for each of the following columns:InvoiceNumberInvoiceDateInvoiceTotalInvoiceLineItemDescriptionInvoiceLineItemAmountHint: Below is the SQL part of the query that you should use so that all you have to add is the XML partSELECT InvoiceNumber, InvoiceDate, InvoiceTotal, InvoiceLineItemDescription AS ItemDescription, InvoiceLineItemAmount AS ItemAmountFROM Invoices AS Invoice JOIN InvoiceLineItems AS LineItemON Invoice.InvoiceID = LineItem.InvoiceIDWHERE Invoice.InvoiceID IN (SELECT InvoiceIDFROM InvoiceLineItemsGROUP BY InvoiceID HAVING COUNT(*) > 1)ORDER BY InvoiceDateSave the XML document that is returned in a file named MultipleLineItems.xmlGenerate an XML schema for the file and save it in a file named MultipleLineItems.xsd

Answers

Answer:

The code is given, paying attention to every column details

Explanation:

columns:

InvoiceNumber

InvoiceDate

InvoiceTotal

InvoiceLineItemDescription

InvoiceLineItemAmount

SELECT InvoiceNumber, InvoiceDate, InvoiceTotal, InvoiceLineItemDescription AS ItemDescription, InvoiceLineItemAmount AS ItemAmount

FROM Invoices AS Invoice JOIN InvoiceLineItems AS LineItem

ON Invoice.InvoiceID = LineItem.InvoiceID

WHERE Invoice.InvoiceID IN (

SELECT InvoiceID

FROM InvoiceLineItems

GROUP BY InvoiceID

HAVING COUNT(*) > 1)

ORDER BY InvoiceDate

FOR XML RAW, ELEMENTS;

Other Questions
How many inches are in 15% of 1.2 feet? Amanda is short of funds to buy machinery for her new business. She approaches her friend, who works in a bank, for help. Amanda gets therequired funds after accepting the bank's terms and conditions. One of the conditions states that she needs to repay the amount in two years.Which source of capital has Amanda received here?A.bondB. loanC.equity shareD. preference share Determine whether the origin is included in the shaded region and whether the shaded region is above or below the line for the graph of the following inequality:y > one half x + 2 (5 points)The origin is not included in the shaded region and the shaded area is above the line.The origin is not included in the shaded region and the shaded area is below the line.The origin is included in the shaded region and the shaded area is above the line.The origin is included in the shaded region and the shaded area is below the line. A certain drug dosage calls for 460 mg per kg per day and is divided into four doses (1 every 6 hours). If a person weighs 229 pounds, how many milligrams of the drug should he receive every 6 hours? Which of the following cannot be disclosed verbally to a customer by an agent of a broker dealer? What point is interected between 10x-3y=19 and 5x+4y=-7 VIOUSNamellaPart 1: Molar MassUse the periodic table to find the molar masses of the followingHCIK2COCa(OH)2Na3PO4 A self-employed taxpayer buys a new business automobile during the year. What method is permitted in computing car and truck expenses on Schedule C? a. The actual cost method b. The standard mileage rate method c. Either the actual cost or the standard mileage rate method d. The actual mileage method e. None of the above Suppose that real GDP is currently $ 13.8 trillion and potential real GDP is $ 14.0 trillion, or a gap of $ 200 billion. The government purchases, multiplier is 5.0, and the tax multiplier is 4.0Holding other factors constant, by how much will government purchases need to be increased to bring the economy to equilibrium at potential GDP?1.Government spending will need to be increased by $ _________ billion (enter your response rounded to the nearest whole number).2. Holding other factors constant, by how much will taxes have to be cut to bring the economy to equilibrium at potential GDP?Taxes will need to be cut by $ _________ billion (enter your response rounded to the nearest whole number). Seat belts and air bags save lives by reducing the forces exerted on the driver and passengers in an automobile collision. Cars are designed with a "crumple zone" in the front of the car. In the event of an impact, the passenger compartment decelerates over a distance of about 1 m as the front of the car crumples. An occupant restrained by seat belts and air bags decelerates with the car. By contrast, an unrestrained occupant keeps moving forward with no loss of speed (Newton's first law!) until hitting the dashboard or windshield. These are unyielding surfaces, and the unfortunate occupant then decelerates over a distance of only about 5 mm .a. A 60 kg person is in a head-on collision. The car's speed at impact is 15 m/s. Estimate the net force on the person if he or she is wearing a seat belt and if the air bag deploys.b. Estimate the net force that ultimately stops the person if he or she is not restrained by a seat belt or air bag.c. How does these two forces compare to the person's weight? PLEASE HELP!!!Nivyana and Ana are selling their apparel to earn money for a cruise. Knitted scarves are $50, and mittens are $25 per pair. They cannot make more than 30 scarves and mittens combined. They need to earn at least $1000 to pay for the cruise and souvenirs.Part A:Write the inequalities that would represent the situationPart B: GRAPH the system of linear inequalities and shade where the solutions are.Part C: Identify two possible solutions to Nivyana and Ana's situation --------- scarves ------------scarves---------------mittens -----------mittens A 9-month-old child with cystic fibrosis does not like taking pancreatic enzyme supplement with meals and snacks. The mother does not like to force the child to take the supplement. The most important reason for the child to take the pancreatic enzyme supplement with meals and snacks is:1.The child will become dehydrated if the supplement is not taken with meals and snacks.2.The child needs these pancreatic enzymes to help the digestive system absorb fats, carbohydrates, and proteins.3.The child needs the pancreatic enzymes to aid in liquefying mucus to keep the lungs clear.4.The child will experience severe diarrhea if the supplement is not taken as prescribed. On the average, 1.6 customers per minute arrive at any one of the checkout counters of Sunshine food market. What type of probability distribution can be used to find out the probability that there will be no customers arriving at a checkout counter in 10 minutes?-Poisson distribution-Normal distribution-Binomial distribution-None of these choices. Match the description in the right column with the information characteristic in the left column. 1. Relevant a. The report was carefully designed so that the data contained on the report became information to the reader 2. Reliable b. The manager was working one weekend and needed to find some information about production requests for a certain customer. He was able to find the report on the companys network. 3. Complete c. The data on a report was checked by two clerks working independently 4. Timely d. An accounts receivable aging report that included all customer accounts 5. Understandable e. A report checked by 3 different people for accuracy 6. Verifiable f. An accounts receivable aging report used in credit granting decisions 7. Accessible g. An accounts receivable aging report was received before the credit manager had to make a decision whether to extend customer credit A radiographic examination of the nasal bones would consist of which of the following positions/projections?A. Parietoacanthial (Waters) projection and lateralB. Parietoacanthial (Waters) and PA (Caldwell) projectionsC. Parietoacanthial (Waters) projection and both lateralsD. Parietoacanthial (Waters) projection, AP axial (Towne) projection and lateral What taxes apply to the benefits under an individual Disability Income Policy on which the insured has paid the premiums? what is a squar plus b squiar Identical twins Anna and Hannah visit you at the optical clinic. Anna, whose eyes can easily focus on distant objects (her far point), is also able to focus on objects within 20 cm of her eyes (her near point). Assuming the diameter and, hence, the distance between the cornea and retina, of Anna's eye is 20 mm, what is the range (in diopters) of Anna's vision? The limits of this range correspond to the total refractive power of her eyes at their far point and and the refractive power at their near point.a) from 50 to 50.5 dioptersb) from 50 to 55 dioptersc) from 50 to 60 dioptersd) from 0 to 5 diopters Jillian is a preschooler with emotion-coaching parents. One may reasonably expect Jillian to______________. Many skeptics have restricted their skepticism to a particular domain of supposed knowledge:1. External world2. Other minds3. Past and future4. Unperceived objects Steam Workshop Downloader