Answer:
public class Class {
private String name ="";
private int score = 0;
//Method SetName
public void setName(String newName){
name = newName;
}
//Method SetScore
public void setScore(int newScore){
score = newScore;
}
//Method GetName
public String getName() {
return name;
}
//Method GetScore
public int getScore() {
return score;
}
}
Explanation:
- The class called Class is implemented in Java programming language
- It has two fields (instance variables name and score)
- Methods for setting the values of variables (mutator methods) or setters
- Methods for getting the values of the variables (accessor methods) getters
Answer:
A clear outline of the consequences of violating the policy is the correct answer to this question.
Explanation:
AUPs are used by schools and universities, corporations, businesses, internet and hosting service providers, and website owners. An acceptable use of policy in AUP helps in many ways:
- Online platforms and applications require users to sign the policy before granting access to any information database, online shop, or other networks.
- An acceptable use policy helps in reducing risk when it comes to online safety, decreased productivity, and damage to both the company and the users.
- One of the main reasons why an acceptable use policy is important is to ensure the safety of users.
- Use of policy is also known as fair use policy.It is set of rules applied by the owner of the network or website.
Answer:
def analyze_text(sentence):
count = 0
e_count = 0
for s in sentence:
s = s.lower()
if s.isalpha():
count += 1
if s == "e":
e_count += 1
return "The text contains " + str(count) + " alphabetic characters, of which " + str(e_count) + " (" + str(e_count*100/count) + "%) are ‘e’."
Explanation:
Create a function called analyze_text takes a string, sentence
Initialize the count and e_count variables as 0
Create a for loop that iterates through the sentence
Inside the loop, convert all letters to lowercase using lower() function. Check each character. If a character is a letter, increment the count by 1. If a character is "e", increment the e_count by 1.
Return the count and e_count in required format
Answer:
Abstraction is the process of removing or taking away certain characteristics to reduce or hide several very important characteristics.
In OOP (Object Oriented Programming), to increase efficiency and reduce complexity, a programmer hides certain vital data about an object. This is abstraction in programming.
For further clarification, a programmer ensures that the name given to an entity makes sense and most importantly, that it carries relevant aspects, and non essential parts are not included.