Problem 1 Handle the exception thrown by the code below by using try and except blocks. In [1]: for i in ['a', 'b', 'c']: print(12) TypeError in () 1 for i in ['a', 'b', 'c']: print (12) ----> 2 TypeError: unsupported operand type(s) for or pow(): 'str' and 'int' Problem 2 Handle the exception thrown by the code below by using try and except blocks. Then use a finally block to print 'All Done. In [2]: x = 5 ye z = x/y Traceback (most recent call last) ZeroDivisionError ZeroDivisionError: division by zero Traceback (most recent call last) in () 2 y = 0 3 ----> 4 z = x/y
Q: Operating system abstraction has several benefits. What are the most significant ones?
A: Given: An operating system acts as a bridge between the hardware and the user. A few of the…
Q: What governance factors should be taken into account while shifting from on-premises servers to an…
A: IaaS stands for Infrastructure as a service and is a type of cloud computing. It is this service in…
Q: What are the benefits of automating server deployment and configuration Consider the drawbacks of…
A: Deployment automation benefits Anyone can deploy. Faster, more efficient deployment. Increased…
Q: What is computer science, and how does it differ from other academic fields? How exactly do they…
A: Computer science Computer Science(CS) is the study of computers and the computational systems.…
Q: What is Redux in detail?
A: More Detail Redux is a container for JavaScript applications that provides a predictable state. As…
Q: What are the benefits of providing and configuring servers automatically? Which of the following are…
A: given - What benefits do servers that are provisioned and configured automatically offer? What…
Q: How does MVC fit into the broader web application framework? Which of the following are advantages…
A: An architectural design pattern called Model-View-Controller (MVC) divides an application into three…
Q: What governance challenges must be addressed throughout the transition from on-premises servers to…
A: The answer to the question is given below:
Q: Which part of a client/server architecture is responsible for storage?
A: A computer system with the two functional units: a server that delivers information or services and…
Q: What do you think about Ada Lovelace?
A: - We need to talk about Ada lovelace.
Q: Is the transfer from on-premise servers to an laaS architecture accompanied by any governance…
A: Does transitioning from on-premise servers to an IaaS architecture raise any governance concerns?…
Q: This is partially due to the tremendous powers of contemporary computers. Exists proof from the past…
A: The scene's similarities to the present day make it simple to recognize. The pupils sit in rows and…
Q: What principles did computer pioneer Ada Lovelace develop?
A: Getting started with Ada Lovelace: Ada Lovelace was an accomplished writer, mathematician, and…
Q: What distinguishes PHP-based website JavaScript-based websites? A194
A: Summary What is the difference between creating a website from HTML, CSS, PHP, JavaScript and using…
Q: In what ways may the usage of cookies in a web application create legal, social, or professional…
A: Usage of cookies in a web application: Web servers may use cookies to identify and monitor users as…
Q: You have been hired to develop the One-Time Pad cipher for a company. You can use any languages such…
A: According to the information given:- we have to follow the instruction in order to get desired…
Q: When migrating IT systems to the cloud, where should you check for governance concerns?
A: Due to that What are some of the governance issues to be on the lookout for while switching from…
Q: Write a Python script to retrieve current date from computer system and prints it in the following…
A: Use the datetime method:- the Python are use datetime method and display the system current date…
Q: Write Test Case Mutation (TCM) Algorithm.
A: Require:T S : A Test SuiteX : Timeout of the New Test SuiteΔ: Set of Mutation OperatorsEnsure:T S :…
Q: A LAN, or local area network, is a kind of computer network used to connect equipment and people…
A: EXPLANATION: The Local Area Network consists of a collection of diverse devices that are linked to…
Q: How does MVC fit into the broader web application framework? Which of the following are advantages…
A: Introduction Model, View, and Controller (MVC): This architectural design pattern divides an…
Q: for python programming make a program, that has a function that takes in a string argument and…
A: The following steps need to be taken for the given program: Ask a string from the user Split the…
Q: Adding a level to Flynn's taxonomy would be beneficial, in our opinion. What differentiates premium…
A: Introduction: We suggest adding one level to Flynn's taxonomy. What makes computers at this level…
Q: What connects all Agile frameworks? Following that, click Submit. A set number of cycles…
A: Given: Work may be planned, managed, and carried out according to a certain methodology known as an…
Q: Describe briefly the three primary phases involved in physical design. Database recovery management…
A: Physical design is the process of determining the data storage organization and access…
Q: If the sequence number space is k bits long, the Go-Back-N and selective-repeat algorithms should be…
A: Data is given by :- The Number of bit use for sequence number = k bits Protocols used : 1)…
Q: What is the Search for Extraterrestrial Intelligence (SETI) and how can the distributed computing…
A: SETI is an acronym that stands for Search For Extraterrestrial Intelligence. SETI explores in space…
Q: Describe some methods for seizing control of a session. What preventative actions might you employ?
A: Depending on the attacker's location and attack vector, the attacker has a variety of methods for…
Q: Because computers have gotten so powerful in recent years, this is the case. When and why did the…
A: In the 1980s and 1990s, widespread computer network connections boosted access to computers and…
Q: What does it mean to "debug" an application?
A: The above question that is what does mean by debug an application is answered below step.
Q: What are the pros and downsides of global connection in cloud computing?
A: Introduction Cloud computing: When easier for the organization to a network of cloud-based servers,…
Q: Write a function named void find FreshFoodDetails (FreshFood food[], int noFood) that prompt the…
A: FreshFood.java file - public class FreshFood { String freshFood, prodPlace; double weight; public…
Q: What language is used to create PHP websites?
A: Definition: Hypertext Preprocessor is referred to as PHP. It is a server side scripting language…
Q: How would you define the role of each component of a typical operating system's kernel if you had to…
A: The kernel is the central manager of these processes. It knows which hardware resources are…
Q: What is a system transition inside the realm of computers?
A: System transition:- To make sure the system is ready to be deployed into the field or in an…
Q: Imagine that your child connects to the school's wireless LAN and types in www.google.com or any…
A: A local area network, or LAN, is a collection of interconnected devices in a single physical…
Q: How knowledgeable are you about computer networking? List the many types of computer networks
A: Computer networking is the term for a network of connected computers that may communicate and share…
Q: Which part of a client/server architecture is responsible for storage
A: A client is a person or a business (organizations ) that uses a service. A computer or other device…
Q: This is due to the fact that computers have gotten so advanced. How can we demonstrate that…
A: Answer: While we often hear about the negative effects of excessive screen time and the dangers of…
Q: Who is familiar with Ada Lovelace's contributions to computer science?
A: At first we need to know who is Ada Lovelace. Ada Byron made a significant contribution to computers…
Q: Perhaps a quick description of the two most important functions of the operating system might appear…
A: Definition: Operating systems are pieces of software that assist computers in performing operations…
Q: What are the pros and downsides of global connection in cloud computing?
A: Pros of cloud: cost reduction: It helps in providing more profit for less money. so when it comes…
Q: xist examples of virtual servers being used in a classroom settin
A: Answer is in next step
Q: Can those with mental or physical disabilities benefit from the internet? What new technologies are…
A: Answer: We need to write the how is the beneficial of internet for the mental or physical disability…
Q: How far has technology advanced over the last many decades, and what kind of technological systems…
A: Over the last few decades, we saw a rise in everyday technology. Social media, cloud computing, and…
Q: Problem. Create a truth table for the expression p V ( q ^ ¬ r ), by filling in the indicated…
A: Answer: Here given three variable so total eight 8 combination are possible So we have create a…
Q: What are the top six reasons why individuals want to study compilers?
A: Introduction: Compilers: A compiler modifies the programming language or a program's type.] Certain…
Q: What functions does Microsoft Excel provide? Provide three examples and descriptions for each.
A: MS Excel is a commercial spreadsheet application that is produced and distributed by Microsoft for…
Q: Which of the following three options for decreasing traffic delays do you propose? What…
A: The data indicate that none of us is driving as much. Why, then, do our roadways seem to be more…
Q: What does the word "data abstraction" mean to you? How may a dataset be subdivided?
A: Data abstraction is the process of reducing a specific set of data to a condensed illustration of…
Step by step
Solved in 3 steps with 2 images
- 1-Write a JAVA program that reads an array from input file and invokes twodifferent methods Sort and Max ,that sorts the elements of the array and findsthe Max element and writes out the resulted array in to output file . Usetwo interfaces for methods and throw Exception Handling for Out Of Boundindex for the array.Instructions: Exception handing Add exception handling to this game (try, catch, throw). You are expected to use the standard exception classes to try functions, throw objects, and catch those objects when problems occur. At a minimum, you should have your code throw an invalid_argument object when data from the user is wrong. File GamePurse.h: class GamePurse { // data int purseAmount; public: // public functions GamePurse(int); void Win(int); void Loose(int); int GetAmount(); }; File GamePurse.cpp: #include "GamePurse.h" // constructor initilaizes the purseAmount variable GamePurse::GamePurse(int amount){ purseAmount = amount; } // function definations // add a winning amount to the purseAmount void GamePurse:: Win(int amount){ purseAmount+= amount; } // deduct an amount from the purseAmount. void GamePurse:: Loose(int amount){ purseAmount-= amount; } // return the value of purseAmount. int GamePurse::GetAmount(){ return purseAmount; } File…CUSTOM EXCEPTION 1 Donor Eligibility Write a C++ program to handle the exception. Read all the details and check for the eligibilty of the donors. Conditions: Age must be greater than 17. Minimum weight should be greater than 44 kg. Maximum amount of blood can be drawn is 350ml. if any of the conditions are not met then throw an exceptibn Refer the sample input/output below. Input and Output Format: Refer sample input and output for formatting specifications. All text in bold corresponds to input and the rest corresponds to output. [All text in bold corresponds to input and P Type here to search
- Exception Code Put this code in a try-catch block. You will need to handle exceptions for DividebyZero, Array error, and general error . In your catches, you may simply just print out an error message: x = car[x] / bar[y];DIRECTION: Using Java as program language Create a simple program for a quiz bee with a class named QuizBee. The program shall:o Contain an array of 15 multiple choice questions with three (3) choiceseach and;o Require the user to choose among A, B or C.o Note: Cases are ignored. Lowercase letters are acceptable (a,b, or c) Create a try-catch structure to handle three (3) exceptions. These are when theuser inputs the following:o An invalid letter (not A, B or C)o A number or any special character.o Blank (no answer). Prompt the user to answer again if any of the three (3) exceptions is thrown. Display the score, number of incorrect answers and corrects answers.Subject: Object Oriented PrgrammingLanguage: Java ProgramTopic: Exception Define a new exception, called ExceptionLineTooLong, that prints out the error message "The strings is too long". Write a program that reads phrase and throws an exception of type ExceptionLineTooLong in the case where a string is longer than 80 characters. EXAMPLE: Input:The quick brown fox jumped over the lazy dogs. Output:The quick brown fox jumped over the laze dogs. ANOTHER EXAMPLE: Input:The quick brown fox jumped over the lazy dogs. The quick brown fox jumped over the lazy dogs.The quick brown fox jumped over the lazy dogs. The quick brown fox jumped over the lazy dogs.The quick brown fox jumped over the lazy dogs. The quick brown fox jumped over the lazy dogs.The quick brown fox jumped over the lazy dogs. The quick brown fox jumped over the lazy dogs.The quick brown fox jumped over the lazy dogs. The quick brown fox jumped over the lazy dogs.The quick brown fox jumped over the lazy dogs. The quick…
- Java Code: -Creates ProgramNode, loops over Parse calls correctly, throws exception if unknown item found -(ParseFunction) Uses MatchAndRemove(), handles any number of parameters, fills in ASTNode correctly -(ParseAction) Uses MatchAndRemove(), handles any number of parameters, fills in ASTNode correctly Make sure to give the correct code for parser.java with the screenshots of the output. There must be test cases involved, so make sure to have test cases as well.Problem Statement:The purpose of this lab assignment is to gain experience in python’s Exception handling. In thisassignment, you will write a program for .edu email address validation system. Problem Design: The program will take an email address from user and check if it contains thefollowing:a. Address must contain at least an ‘@’ symbolb. Address must contain at least a ‘.edu’ suffixc. Length must contain at least 12 characters.d. Address must contain at least one digit 2. Helper functions to check if an address has at least one digit is provided. Docstring arealso given in the template file. This function returns True if condition satisfies otherwisereturns False. 3. Your task: Design a base class (Invalid Address) and child exception classes(InsufficientLength, NoDigit, NoEdu, NoAtSymbol ) to raise the exception when theconditions are not met. 4. Design a simple user menu to ask for the address as long as the user does not enter a validaddress. 5. The menu should also make a…Q1 (Creating Custom Exception Class) Write a Password class that stores a password string. Passwords must contain at least seven alpha-numeric characters, with at least one letter and one digit. Also write an InvalidPasswordException class that extends Exception. The Password constructor should throw an InvalidPasswordException, which should report an appropriate message based on a given string (e.g. if the string contains no digits, the exception should report this fact). Write a GUI program to prompt the user to enter a password and report an InvalidPasswordException if an invalid password is entered. Please teach and help me how to deisgn the program based on the two files given .Some sample screenshots are shown below: InvalidPasswordException.java public class InvalidPasswordException extends Exception{ public InvalidPasswordException (String errMsg){ super(errMsg); } } Password.java public class Password {private String passwordstr; public…
- //java Part I: Code an application using the BigDecimalclass to calculate the return of an investment. Use the same formula found in FutureValueand FutureValueApp2in Ch5 from the downloaded source code examples for the calculation. You must format the currency and percent (keeping 3 positions to the right of the decimal point in percent) and handle any exceptions (letter and out of range entries) that may occur from the input data. The valid range of investment amounts is from $1.00 to $1,000,000.00. The valid return rate is from 0.1% to 3.5%. The valid period of investment years is from 1 to 100. Your program must continue to run until the user enters “n” to terminate the execution. You must validate the user's entry so that only “y” and “n” are accepted. Save your code as fileFutureValueBigDeci malApp.java. (Suggestions: Modify Validator so it will add a new validateDoubleWithRange(Scanner sc, String prompt, double min, double max) method and a newvalidateIntWithRange(Scanner, sc,…2. Catching Exceptions Implement Exception handling for the programs you have written in the laboratory exercises as listed below. Note that all data to be used for processing must be input data (data entry from the user). When an invalid data is entered, the program should loop back to data entry until the input becomes valid. Sample Output: run: *******CIRCLE CALCULATOR******* Enter the radius --> a INVALID INPUT! Enter the radius --> ? INVALID INPUT! Enter the radius --> 10 Result: Area:314.0 Diameter:20.0 Circumference:62.800000000000004 BUILD SUCCESSFUL (total time: 20 seconds)JAVA EXCEPTION HANDLING:Define a new exception, called ExceptionLineTooLong, that prints out the error message "The strings is too long". Write a program that reads phrase and throws an exception of type ExceptionLineTooLong in the case where a string is longer than 80 characters. For example: Input Result The quick brown fox jumped over the lazy dogs. The quick brown fox jumped over the lazy dogs. The quick brown fox jumped over the lazy dogs. The quick brown fox jumped over the lazy dogs.The quick brown fox jumped over the lazy dogs. The quick brown fox jumped over the lazy dogs.The quick brown fox jumped over the lazy dogs. The quick brown fox jumped over the lazy dogs.The quick brown fox jumped over the lazy dogs. The quick brown fox jumped over the lazy dogs.The quick brown fox jumped over the lazy dogs. The quick brown fox jumped over the lazy dogs.The quick brown fox jumped over the lazy dogs. The quick brown fox jumped over the lazy dogs.The quick brown fox jumped…