Answer:
Prediction
With regard to preparedness for hazard/disaster, technology such as AI are being explored to see how they can help to predict natural disaster.
If there is a breakthrough in this space, it will drastically reduce the negative impact of natural disasters such as floods and earthquakes as people will become ready to respond to them and mitigate their effects where possible.
In agriculture, there are factors which come together to bring about flooding. Flooding is one of the major disasters which cripples entire value chains. With a potential threat anticipated or predicted by AI, businesses can invest in technologies that can help protect the farms, farmland and other resources critical to such a supply chain.
AI-powered technologies that provide prediction services often combine this advanced computing prowess with the ability to process big data.
Technology can reach places that are unreachable by humans
AI-powered robots will soon become the norm.
Presently there are self-learning and self instructing robots powered by Artificial Intelligence that have applications in warfare, manufacturing, deepsea diving and intelligence gathering, and transportation. It is not out of place to predict that in the next decade, scientists would have perfected rescue robots that can go into very unstable terrain that have been damaged by flood or earthquake and attempt a rescue of lives and property at a scale that has never been possible before.
Connectivity
Connectivity helps people access to aid, resources that are critical for survival, transmission and receipt of life--saving information etc. CISCO has successfully used its technology called TacOps (short for Tactical Operations) successfully 45 times on over 5 continents.
Cheers!
A __________ infrastructure is made available to the general public or a large industrygroup and is owned by an organization selling cloud services.
a. community cloud
b. hybrid cloud
c. public cloud
d. private cloud
[tex]\Huge{\fbox{\red{Answer:}}}[/tex]
A public cloud infrastructure is made available to the general public or a large industrygroup and is owned by an organization selling cloud services.
[tex]<font color=orange>[/tex]
a. community cloud
b. hybrid cloud
c. public cloud ✔
d. private cloud
Let PALINDROME_DFA= | M is a DFA, and for all s ∈ L(M), s is a palindrome}. Show that PALINDROME_DFA ∈ P by providing an algorithm for it that runs in polynomial time.
Answer:
Which sentence best matches the context of the word reticent as it is used in the following example?
We could talk about anything for hours. However, the moment I brought up dating, he was extremely reticent about his personal life.
Explanation:
Which sentence best matches the context of the word reticent as it is used in the following example?
We could talk about anything for hours. However, the moment I brought up dating, he was extremely reticent about his personal life.
In using cloud infrastructures, the client necessarily cedes control to the CP on a number of issues that may affect security
a. True
b. False
Answer:
A. True
Explanation:
The correct option is A. True.
Actually, in using cloud infrastructures, the client necessarily cedes control to the CP on a number of issues which may affect security. It may have to restrict port scans and even penetration testing. Moreover, the service level agreements may not actually guarantee commitment to offer such services on the part of the CP. This may result in leaving a gap in security defenses.
Also, when the control of the CP changes, it's evident that the terms and conditions of their services may also change which may affect security.
In the three As of security, which part pertains to describing what the user account does or doesn't have access to
Answer:
Authorization
Explanation:
Write a method that accepts a String object as an argument and returns a copy of the string with the first character of each sentence capitalized. For instance, if the argument is "hello. my name is Joe. what is your name?" the method should return the string "Hello. My name is Joe. What is your name?" Demonstrate the method in a program that asks the user to input a string and then passes it to the method. The modified string should be displayed on the screen.
Answer:
The programming language is not stated; However, the program written in C++ is as follows: (See Attachment)
#include<iostream>
using namespace std;
string capt(string result)
{
result[0] = toupper(result[0]);
for(int i =0;i<result.length();i++){
if(result[i]=='.' || result[i]=='?' ||result[i]=='!') {
if(result[i+1]==' ') {
result[i+2] = toupper(result[i+2]);
}
if(result[i+2]==' ') {
result[i+3] = toupper(result[i+3]);
}
} }
return result;
}
int main(){
string sentence;
getline(cin,sentence);
cout<<capt(sentence);
return 0;
}
Explanation:
The method to capitalize first letters of string starts here
string capt(string result){
This line capitalizes the first letter of the sentence
result[0] = toupper(result[0]);
This iteration iterates through each letter of the input sentence
for(int i =0;i<result.length();i++){
This checks if the current character is a period (.), a question mark (?) or an exclamation mark (!)
if(result[i]=='.' || result[i]=='?' ||result[i]=='!') {
if(result[i+1]==' '){ ->This condition checks if the sentence is single spaced
result[i+2] = toupper(result[i+2]);
-> If both conditions are satisfied, a sentence is detected and the first letter is capitalized
}
if(result[i+2]==' '){ ->This condition checks if the sentence is double spaced
result[i+3] = toupper(result[i+3]);
-> If both conditions are satisfied, a sentence is detected and the first letter is capitalized
}
}
} The iteration ends here
return result; ->The new string is returned here.
}
The main method starts here
int main(){
This declares a string variable named sentence
string sentence;
This gets the user input
getline(cin,sentence);
This passes the input string to the method defined above
cout<<capt(sentence);
return 0;
}
Write a function called "equals" that accepts 2 arguments The two arguments will be of type list The function should return one string, either "Equals" or "Not Equals" For the lists to be equal, they need to: Have the same number of elements Have all the elements be of the same type Have the order fo the elements be the same DO NOT USE "
Answer:
import numpy as np
def equals(list1, list2 ):
compare = np.all( list1, list2)
if ( compare == True):
print ( "Equals")
else :
print(" Not Equals")
Explanation:
This python function utilizes the numpy package to compare two list items passed as its argument. It prints out "equals" for a true result and "not equal" for a false result.
Diverting an attacker from accessing critical systems, collecting information about the attacker's activity and encouraging the attacker to stay on the system long enough for administrators to respond. These are all benefits of what network appliance?
Answer:
Honeypot is the correct answerExplanation:
A computer system that is meant to mimic the likely targets of cyber attacks is called honeypot. It is used to deflect the attackers from a legitimate target and detect attacks. It also helps to gain info about how the cyber criminals operate. They have been around for decades, it works on the philosophy that instead of searching for attackers, prepare something that would attract them. It is just like cheese-baited mousetraps. Cyber criminals get attracted towards honeypots by thinking that they are legitimate targets.
Advantages of e commerce
Answer:
A Larger Market
Customer Insights Through Tracking And Analytics
Fast Response To Consumer Trends And Market Demand
Lower Cost
More Opportunities To "Sell"
Personalized Messaging
Hope this helps!
While the Internet can be a great resource, the information is not always reliable, as anyone can post information. Select one: True False
Answer: True
Explanation: Because anyone can post something and it can be non reliable
10.7 LAB: Fat-burning heart rate Write a program that calculates an adult's fat-burning heart rate, which is 70% of 220 minus the person's age. Complete fat_burning_heart_rate() to
Answer:
I've written in python
Explanation:
age = int(input("Enter the person's age: ")
def fat_burning_heart_rate(x):
rate =( 70/100 * 220 ) - age
print(fat_burning_heart_rate(age))
Discuss the 21 st century competencies or skills required in the information society and 4 ways you can apply it during supported teaching on schools
Answer:
Life skills, learning skills, The literacy skills
Explanation:
There are different type of skills that are required in schools, educational societies, organizations. Now these students need more attention to focus on their carrier. There are different of skills such as:
There are another three skills like
The learning skillsThe literacy skillsThe life skills. CreativityCollaborationCommunicationMedia literacyLeadershipFlexibilityInitiativeSocial skillsProductivityCritical thinking.These are some skills that help students that keep up the lightening -pace in todays modern society. All skills are unique and used differently by students.
Individually or in a group find as many different examples as you can of physical controls and displays.a. List themb. Try to group them, or classify them.c. Discuss whether you believe the control or display is suitable for its purpose.
Answer:
Open ended investigation
Explanation:
The above is an example of an open ended investigation. In understanding what an open ended investigation is, we first of all need to understand what open endedness means. Open endedness means whether one solution or answer is possible. In other words it means that there may be various ways and alternatives to solve or answer a question or bring solution to an investigation.
From the definition, we can deduce that an open ended investigation is a practical investigation that requires students to utilize procedural and substantive skills in arriving at conclusion through evidence gathered from open ended research or experiment(as in not close ended, not limited to ready made options, freedom to explore all possibilities). This is seen in the example question where students are asked to explore the different examples of physical controls and displays and also discuss their observations. Here students are not required to produce a predefined answer but are free to proffer their own solutions
_________ enables customers to combine basic computing services,such as number crunching and data storage,to build highly adaptable computer systems.A) IaaSB) EAP peerC) CPD) SaaS
Answer:
The correct answer to the question is option A (IaaS)
Explanation:
IaaS (Infrastructure as a Service) can be used for data storage, backup, recovery, web hosting, and various other uses as it is cost-effective, and it also has secured data centers. It is a service delivery method by a provider for cloud computing as it enables customers to be offered the service the possibility to combine basic computing services to build and direct access to safe servers where networking can also be done. These services rendered by the providers allow users to install operating systems thereby making it possible to build highly adaptable computer systems.
SaaS (Software as a Service): Here, the service provider bears the responsibility of how the app will work as what the users do is to access the applications from running on cloud infrastructure without having to install the application on the computer.
The cloud provider (CP) as the name suggests is anybody or group of persons that provide services for operations within the cloud.
Gary frequently types his class assignment. His ring automatically types the letter O. What is Gary using when he types?
A.Keyboard shortcut
B.Home row
C.Muscle memory
D.Windows logo
Why operating system is pivotal in teaching and learning
Answer:
Without it information flow is impossible
Explanation:
The word 'pivotal' also means crucial or vital, and so we need to consider what an operating system actually does.
Remember, merely having all the hardware of a computer would not allow you to run (install and use) programs. It is by means of an operating system that teaching programs can be installed, and it is also by means of an operating system learning can take place.
For example, a student can decode (learn) instructions/lessons from his teacher via a software program; and the software program needs an operating system to open (run) the program.
Declare a class named PatientData that contains two attributes named height_inches and weight_pounds. Sample output for the given program with inputs: 63 115 Patient data (before): 0 in, 0 lbs Patient data (after): 63 in, 115 lbs 1 Your solution goes here ' 2 1 test passed 4 patient PatientData () 5 print('Patient data (before):, end-' ') 6 print(patient.height_inches, 'in,, end=' ') 7 print(patient.weight_pounds, lbs') All tests passed 9 10 patient.height_inches = int(input()) 11 patient.weight_pounds = int(input()) 12 13 print('Patient data (after):', end-' ') 14 print (patient. height_inches, 'in,', end- ') 15 print(patient.weight_pounds, 'lbs') Run
Answer:
class PatientData(): #declaration of PatientData class
height_inches=0 #attribute of class is declared and initialized to 0
weight_pounds=0 #attribute of class is declared and initialized to 0
Explanation:
Here is the complete program:
#below is the class PatientData() that has two attributes height_inches and weight_pounds and both are initialized to 0
class PatientData():
height_inches=0
weight_pounds=0
patient = PatientData() #patient object is created of class PatientData
#below are the print statements that will be displayed on output screen to show that patient data before
print('Patient data (before):', end=' ')
print(patient.height_inches, 'in,', end=' ')
print(patient.weight_pounds, 'lbs')
#below print statement for taking the values height_inches and weight_pounds as input from user
patient.height_inches = int(input())
patient.weight_pounds = int(input())
#below are the print statements that will be displayed on output screen to show that patient data after with the values of height_inches and weight_pounds input by the user
print('Patient data (after):', end=' ')
print(patient.height_inches, 'in,', end=' ')
print(patient.weight_pounds, 'lbs')
Another way to write the solution is:
def __init__(self):
self.height_inches = 0
self.weight_pounds = 0
self keyword is the keyword which is used to easily access all the attributes i.e. height_inches and weight_pounds defined within a PatientData class.
__init__ is a constructor which is called when an instance is created from the PatientData, and access is required to initialize the attributes height_inches and weight_pounds of PatientData class.
The program along with its output is attached.
In this exercise we have to use the knowledge of computational language in python to describe a code, like this:
The code can be found in the attached image.
To make it easier the code can be found below as:
class PatientData():
height_inches=0
weight_pounds=0
patient = PatientData()
print('Patient data (before):', end=' ')
print(patient.height_inches, 'in,', end=' ')
print(patient.weight_pounds, 'lbs')
patient.height_inches = int(input())
patient.weight_pounds = int(input())
print('Patient data (after):', end=' ')
print(patient.height_inches, 'in,', end=' ')
print(patient.weight_pounds, 'lbs')
See more about python at brainly.com/question/26104476
The policy that allows a transaction to commit even if it has modified some blocks that have not yet been written back to disk is called the __________ policy.
Answer:
No-force policy
Explanation:
The policy that allows a transaction to commit even if it has modified some blocks that have not yet been written back to disk is called the _NO-FORCE_ policy.
In data theory, the No-Force Policy is beneficial for the control of transaction. In this policy, when a transaction commits, changes that are made are not required to be written to disk in place. The changes recorded are preserved in order to make transaction durable. The recorded changes must be preserved at commit time.
3. Which of the following is called address operator?
a)*
b) &
c).
d) %
Answer:
The Ampersand Symbol (Option B)
Explanation:
A 'address of operator' specifies that a given value that is read needs to be stored at the address of 'x'.
The address operator is represented by the ampersand symbol. ( & )
Hope this helps.
Append newValue to the end of vector tempReadings. Ex: If newValue = 67, then tempReadings = {53, 57, 60} becomes {53, 57, 60, 67}.
#include
#include
using namespace std;
int main() {
vector tempReadings(3);
int newValue = 0;
unsigned int i = 0;
tempReadings.at(0) = 53;
tempReadings.at(1) = 57;
tempReadings.at(2) = 60;
newValue = 67;
/* Your solution goes here */
for (i = 0; i < tempReadings.size(); ++i) {
cout << tempReadings.at(i) << " ";
}
cout << endl;
return 0;
}
2.Remove the last element from vector ticketList.
#include
#include
using namespace std;
int main() {
vector ticketList(3);
unsigned int i = 0;
ticketList.at(0) = 5;
ticketList.at(1) = 100;
ticketList.at(2) = 12;
/* Your solution goes here */
for (i = 0; i < ticketList.size(); ++i) {
cout << ticketList.at(i) << " ";
}
cout << endl;
return 0;
}
3. Assign the size of vector sensorReadings to currentSize.
#include
#include
using namespace std;
int main() {
vector sensorReadings(4);
int currentSize = 0;
sensorReadings.resize(10);
/* Your solution goes here */
cout << "Number of elements: " << currentSize << endl;
return 0;
}
4. Write a statement to print "Last mpg reading: " followed by the value of mpgTracker's last element. End with newline. Ex: If mpgTracker = {17, 19, 20}, print:
Last mpg reading: 20
#include
#include
using namespace std;
int main() {
vector mpgTracker(3);
mpgTracker.at(0) = 17;
mpgTracker.at(1) = 19;
mpgTracker.at(2) = 20;
/* Your solution goes here */
return 0;}
Answer:
Following are the code to this question:
In question 1:
tempReadings.push_back(newValue); //using array that store value in at 3 position
In question 2:
ticketList.pop_back(); //defining ticketList that uses the pop_back method to remove last insert value
In question 3:
currentSize = sensorReadings.size(); /defining currentSize variable holds the sensorReadings size value
In question 4:
cout<<"Last mpg reading: "<<mpgTracker.at(mpgTracker.size()-1)<<endl;
//using mpgTracker array with at method that prints last element value
Explanation:
please find the attachment of the questions output:
In the first question, it uses the push_back method, which assigns the value in the third position, that is "53, 57, 60, and 67 "In the second question, It uses the pop_back method, which removes the last element, that is "5 and 100"In the third question, It uses the "currentSize" variable to holds the "sensorReadings" size value, which is "10".In the fourth question, It uses the mpgTracker array with the "at" method, which prints the last element value, which is "20".Using data from interviews with ESCO executives conducted in late 2012, this study examines the market size, growth forecasts, and industry trends in the United States for the ESCO sector.
Thus, It uses the "currentSize" variable to holds the "sensorReadings" size value, which is "10". In the fourth question, It uses the mpgTracker array with the "at" method, which prints the last element value, which is "20".
There are numerous types of gateways that can operate at various protocol layer depths.
Application layer gateways (ALGs) are also frequently used, albeit most frequently a gateway refers to a device that translates the physical and link layers. It is best to avoid the latter because it complicates deployments and is a frequent source of error.
Thus, Using data from interviews with Gateway executives conducted in late 2012, this study examines the market size, growth Esco size and industry trends in the United States for the Gateway.
Learn more about Gateway, refer to the link:
https://brainly.com/question/30167838
#SPJ6
Develop a CPP program to test is an array conforms heap ordered binary tree. This program read data from cin (console) and gives an error if the last item entered violates the heap condition. Use will enter at most 7 numbers. Example runs and comments (after // ) are below. Your program does not print any comments. An output similar to Exp-3 and Exp-4 is expected.
Exp-1:
Enter a number: 65
Enter a number: 56 // this is first item (root,[1]) in the heap three. it does not violate any other item. So, no // this is third [3] number, should be less than or equal to its root ([1])
Enter a number: 45 // this is fourth number, should be less than or equal to its root ([2])
Enter a number: 61 // this is fifth number, should be less than or equal to its root ([2]). It is not, 61 > 55. The 61 violated the heap.
Exp-2:
Enter a number: 100
Enter a number: 95 1/ 95 < 100, OK
Enter a number: 76 // 76 < 100, OK
Enter a number: 58 // 58 < 95, OK
Enter a number: 66 1/ 66 < 95, OK
Enter a number: 58 // 58 < 76, OK
Enter a number: 66 // 66 < 76, OK
Exp-3:
Enter a number: -15
Enter a number: -5
-5 violated the heap.
Exp-4:
Enter a number: 45
Enter a number: 0
Enter a number: 55
55 violated the heap.
Answer:
Following are the code to this question:
#include<iostream>//import header file
using namespace std;
int main()//defining main method
{
int ar[7];//defining 1_D array that stores value
int i,x=0,l1=1,j; //defining integer variable
for(i=0;i<7;i++)//defining for loop for input value from user ends
{
cout<<"Enter a Number: ";//print message
cin>>ar[i];//input value in array
if(l1<=2 && i>0)//using if block that checks the array values
{
x++;//increment the value of x by 1
}
if(l1>2 && i>0)//using if block that checks the array values
{
l1=l1-2;//using l1 variable that decrases the l1 value by 2
}
j=i-x;//using j variable that holds the index of the root of the subtree
if(i>0 && ar[j]>ar[i])// use if block that checks heap condition
{
l1++; //increment the value of l1 variable
}
if(i>0 && ar[j]<ar[i])// using the if block that violate the heap rule
{
cout<<ar[i]<<" "<<"Violate the heap";//print message with value
break;//using break keyword
}
}
return 0;
}
Output:
1)
Enter a Number: -15
Enter a Number: -5
-5 Violate the heap
2)
Enter a Number: 45
Enter a Number: 0
Enter a Number: 55
55 Violate the heap
Explanation:
In the above-given C++ language code, an array "ar" and other integer variables " i,x,l1, j" is declared, in which "i" variable used in the loop for input values from the user end.In this loop two, if block is defined, that checks the array values and in the first, if the block it will increment the value of x, and in the second if the block, it will decrease the l1 value by 2.In the next step, j variable is used that is the index of the root of the subtree. In the next step, another if block is used, that checks heap condition, that increment the value of l1 variable. In the, if block it violate the heap rule and print its values.When you start your computer then which component works first?
Questions: 1) Sequential pattern mining is a topic of data mining concerned with finding statistically relevant patterns between data examples where the values are delivered in a sequence. Discuss what is sequential data
Answer and Explanation:
The sequential data or sequence data is described as data that come in an ordered sequence. It may also be termed data that is produced from tasks that occurs in sequential order The sequential pattern mining is a critical subject in data mining that has do with applying sequential data to derive a statistically relevant pattern from it.
Sequential pattern mining is a part of data mining. Data mining involves utilizing data from databases to understand and make decisions that better the organization or society as a whole based on this. Common data mining tasks include: clustering, classification, outlier analysis, and pattern mining.
Pattern mining is a kind of data mining task that involves explaining data through finding useful patterns from data in databases. Sequential pattern mining is pattern mining that uses sequential data as a source of data in finding data patterns. Sequential pattern mining applies various criteria(which maybe subjective) in finding "subsequence" in data. Criteria could be :frequency, length, size, time gaps, profit etc. Sequential pattern mining is commonly applicable in reality since a sizeable amount of data mostly occur in this form. A popular type of sequential data is the time series data.
what are 3 important reasons to reconcile bank and credit card accounts at set dates?
Answer:
To verify transactions have the correct date assigned to them.
To verify that an account balance is within its credit limit.
To verify that all transactions have been recorded for the period.
Explanation:
Each time we add another bit, what happens to the amount of numbers we can make?
Answer:
When we add another bit, the amount of numbers we can make multiplies by 2. So a two-bit number can make 4 numbers, but a three-bit number can make 8.
The amount of numbers that can be made is multiplied by two for each bit to be added.
The bit is the most basic unit for storing information. Bits can either be represented as either 0 or 1. Data is represented by using this multiple bits.
The amount of numbers that can be gotten from n bits is given as 2ⁿ.
Therefore we can conclude that for each bit added the amount of numbers is multiplied by two (2).
Find more about bit at: https://brainly.com/question/20802846
Which of the following is true about sorting functions?
A. The most optimal partitioning policy for quicksort on an array we know nothing about would be selecting a random element in the array.
B. The fastest possible comparison sort has a worst case no better than O(n log n)
C. Heapsort is usually best when you need a stable sort.
D. Sorting an already sorted array of size n with quicksort takes O(n log n) time.
E. When sorting elements that are expensive to copy, it is generally best to use merge sort.
F. None of the above statements is true.
Answer: Option D -- Sorting an already sorted array of size n with quicksort takes O(n log n) time.
Explanation:
Sorting an already sorted array of size n with quicksort takes O(n log n) time is true about sorting functions while other options are wrong.
Giving BRANLIEST IFF CORRECT What is the label called for each column in a database? Field File Record Title
Answer:
Title
Explanation:
the others describe other items in a database
Answer:
Title
Explanation: idek but I got it correct on a quiz
A ………….. is a basic memory element in digital circuits and can be used to store 1 bit of information.
Answer:
A memory cellExplanation: Research has proven that ;
The memory cell is also known as the fundamental building block of computer memory.
It stores one bit of binary information and it must be set to store a logic 1 (high voltage level) and reset to store a logic 0 (low voltage level).
Create a class named CarRental that contains fields that hold a renter's name, zip code, size of the car rented, daily rental fee, length of rental in days, and total rental fee. The class contains a constructor that requires all the rental data except the daily rate and total fee, which are calculated bades on the sice of the car; economy at $29.99 per day, midsize at 38.99$ per day, or full size at 43.50 per day. The class also includes a display() method that displays all the rental data. Create a subclass named LuxuryCarRental. This class sets the rental fee at $79.99 per day and prompts the user to respond to the option of including a chauffer at $200 more per day. Override the parent class display() method to include chauffer fee information. Write an application named UseCarRental that prompts the user for the data needed for a rental and creates an object of the correct type. Display the total rental fee. Save the files as CarRental.java, LuxaryCarRental.java, and UseCarRental.java.
Here is my code:
package CarRental;
public class CarRental
{
String name;
int zipcode;
String size;
double dFee;
int days;
double total;
public String getName()
{
return name;
}
public int getZipcode()
{
return zipcode;
}
public String getSize()
{
return size;
}
public int getDays()
{
return days;
}
public CarRental(String size)
{
if(size.charAt(0)=='m')
dFee = 38.99;
else
if(size.charAt(0)=='f')
dFee = 43.50;
else
dFee = 29.99;
}
public void calculateTotal(int days)
{
total = dFee*days;
}
public void print()
{
System.out.println("Your rental total cost is: $" + total);
}
}
package CarRental;
import java.util.*;
public class LuxaryCarRental extends CarRental
{
public LuxaryCarRental(String size, int days)
{
super(size);
}
public void CalculateTotalN()
{
super.calculateTotal(days);
dFee = 79.99;
int chauffer;
Scanner keyboard = new Scanner(System.in);
System.out.println("Do you want to add a chauffer for $200? Enter 0 for"
+ " yes and 1 for no");
chauffer = keyboard.nextInt();
if(chauffer!=1)
total = dFee;
else
total = dFee + 100;
}
}
package CarRental;
import java.util.*;
public class UseCarRental
{
public static void main(String args[])
{
String name, size;
int zipcode, days;
Scanner keyboard = new Scanner(System.in);
System.out.println("Enter total days you plan on renting: ");
days = keyboard.nextInt();
System.out.println("Enter your name: ");
name = keyboard.next();
System.out.println("Enter your billing zipcode: ");
zipcode = keyboard.nextInt();
System.out.println("Enter the size of the car: ");
size = keyboard.next();
CarRental economy = new CarRental(size);
economy.calculateTotal(days);
economy.print();
LuxaryCarRental fullsize = new LuxaryCarRental(size, days);
fullsize.CalculateTotalN();
fullsize.print();
}
Answer:
Here is the corrected code: The screenshot of the program along with its output is attached. The comments are written with each line of the program for better understanding of the code.
CarRental.java
public class CarRental { //class name
//below are the data members name, zipcode, size, dFee, days and total
String name;
int zipcode;
String size;
double dFee;
int days;
double total;
public String getName() { //accessor method to get the name
return name; }
public int getZipcode() { //accessor method to get the zipcode
return zipcode; }
public String getSize() { //accessor method to get the size
return size; }
public int getDays() { //accessor method to get the days
return days; }
public CarRental(String size) { //constructor of CarRental class
if(size.charAt(0)=='e') // checks if the first element (at 0th index) of size data member is e
dFee = 29.99; // sets the dFee to 29.99
else if(size.charAt(0)=='m') // checks if the first element (at 0th index) of size data member is m
dFee = 38.99; // sets the dFee to 38.99
else // checks if the first element (at 0th index) of size data member is f
dFee =43.50; // sets the dFee to 43.50
}
public void calculateTotal(int days) { //method calculateTotal of CarRental
total = dFee*days; } //computes the rental fee
public void print() { //method to display the total rental fee
System.out.println("Your rental total cost is: $" + total); } }
Explanation:
LuxuryCarRental.java
import java.util.*;
public class LuxuryCarRental extends CarRental { //class LuxuryCarRental that is derived from class CarRental
public LuxuryCarRental(String size, int days) { // constructor of LuxuryCarRental
super(size);} //used when a LuxuryCarRental class and CarRental class has same data members i.e. size
public void calculateTotal() { //overridden method
super.calculateTotal(days); // used because CarRental and LuxuryCarRental class have same named method i.e. calculateTotal
dFee = 79.99; //sets the rental fee at $79.99 per day
total = dFee; } //sets total to rental fee value
public void print(){ //overridden method
int chauffeur; // to decide to include chauffeur
Scanner keyboard = new Scanner(System.in); //used to take input from user
System.out.println("Do you want to add a chauffeur for $200? Enter 0 for"
+ " yes and 1 for no"); // prompts the user to respond to the option of including a chauffeur at $200 more per day
chauffeur = keyboard.nextInt(); //reads the input option of chauffeur from user
if(chauffeur==1) //if user enters 1 which means user does not want to add a chauffeur
total = dFee; //then set the value of dFee i.e. $79.99 to total
else //if user enters 0 which means user wants to add a chauffeur
total = dFee + 200; //adds 200 to dFee value and assign the resultant value to total variable
System.out.println("Your rental total cost is: $" + total); } } //display the total rental fee
UseCarRental.java
import java.util.*;
public class UseCarRental{ //class name
public static void main(String[] args){ //start of main() function body
String name, size; // declare variables
int zipcode, days; //declare variables
Scanner keyboard = new Scanner(System.in); // to take input from user
System.out.println("Enter total days you plan on renting: "); //prompts user to enter total days of rent
days = keyboard.nextInt(); // reads value of days from user
System.out.println("Enter your name: "); //prompts user to enter name
name = keyboard.next(); //reads input name from user
System.out.println("Enter your billing zipcode: "); // prompts user to enter zipcode
zipcode = keyboard.nextInt(); //reads input zipcode from user
System.out.println("Enter the size of the car: "); // prompts user to enter the value of size
size = keyboard.next(); //reads input size from user
CarRental economy = new CarRental(size); //creates an object i.e. economy of class CarRental
economy.calculateTotal(days); //calls calculateTotal method of CarRental using instance economy
economy.print(); //calls print() method of CarRental using instance economy
LuxuryCarRental fullsize = new LuxuryCarRental(size, days); //creates an object i.e. fullsize of class LuxuryCarRental
fullsize.calculateTotal(); //calls calculateTotal method of LuxuryCarRental using instance fullsize
fullsize.print(); }} //calls print() method of LuxuryCarRental using instance fullsize
which programming paradigm do programmers follow to write code for event driven applications? a. object oriented programming. b. functional c. nonprocedural. d. procedural
Answer:
D) Procedural
Explanation:
Answer:
Object-Oriented Programming
Explanation:
the part of the computer that contains the brain , or central processing unit , is also known the what ?
Answer:
system unit
Explanation:
A system unit is the part of a computer that contains the brain or central processing unit. The primary device such as central processing unit as contained in the system unit perform operations hence produces result for complex calculations.
The system unit also house other main components of a computer system like hard drive , CPU, motherboard and RAM. The major work that a computer is required to do or performed is carried out by the system unit. Other peripheral devices are the keyboard, monitor and mouse.