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.

Answers

Answer 1

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;

}


Related Questions

What is true about the pivot in Quicksort? Group of answer choices After partitioning, the pivot will always be in the center of the list. After partitioning, the pivot will never move again. Before partitioning, it is always the smallest element in the list. A random choice of pivot is always the optimal choice, regardless of input.

Answers

Answer:

The pivot is selected randomly in quick sort.

UAAR is planning to build in house software similar to Zoom Application. University Authorities contact with you in order to provide best solution with in limited time and limited resources in term of cost.
Describe the roles, Artifacts and activities, keeping in view Scrum process model.
Compare and contract your answer with scrum over XP for development of above mention system. Justify your answer with the help of strong reasons, why you choose scrum model over XP model. How scrum is more productive for project management. Furthermore, highlight the shortcoming of XP model.

Answers

Answer:

Following are the answer to this question:

Explanation:

If working to develop Zoom-like house software, its best solution is now in a limited period of time even with effectively reduced assets;  

Evaluate all roles in preparation  

Create a "Pool Draw"  

Choose a singular set of resources.  

Utilize Time Recording.  

Concentrate on assignments and project objectives.  

An object, in which by-product of the development in the software. It's created for the development of even a software program. It could include database schemas, illustrations, configuration screenplays-the list just goes on.  

All development activities of Scrum are composed with one or several groups from a lineout, each containing four ruck roles:  

Holder of the drug  

ScrumMaster and Master  

Equipment for development.  

Owner of the drug

It is the motivating core of the product marketing idea, that Keeps transparent the vision about what the team member is trying to seek so that to accomplish as well as interacts to all of the other members, the project manager is responsible for the success of the way to solve being formed or retained.  

ScrumMaster   It operates as a mentor and providing guidance throughout the development phase, it takes a leadership position in the abolishment with impediments that also impact employee productivity and therefore have no ability to control the team, but the roles of both the project team or program manager are not quite the same thing. It works as a leader instead of the management team.  

Equipe for development

The Scrum characterizes the design team as a diverse, multi-functional community of individuals who design, construct as well as evaluate the application of those who want.  

In this usually 5 to 9 individuals; one's representatives should be able to make quality responsive applications collaboratively.  

It is a framework that operates along with teams. It is often seen as agile project management as well as explains a set of conferences, techniques, and roles that also assist individuals to organize as well as complete their employees together.  The multidisciplinary team from Scrum means that a person should take a feature from idea to completion.

Scrum and XP differences:  

Its team members in Scrum usually operate in the various weeks with one month-long incarnation. The XP teams generally work in incarnations which are either one two weeklong.  Scrum doesn't write a prescription the certain project management; XP seems to do.  Scrum may not make access to other their sprints. XP teams are far more receptive to intervention inside of their repetitions.

Which wireless device connects multiple laptops, tablets, phones, and other mobile devices in a corporate environment?

Answers

Answer:

Bluetooth or a wifi router or a gateway

Explanation:

Your location has been assigned the 172.149.254.0 /24 network. You are tasked with dividing the network into 13 subnets with the maximum number of hosts possible on each subnet.

Required:
a. What is the dotted decimal value for the subnet mask?
b. How many additional bits will you need to mask in the subnet mask?

Answers

The subnet mask would be a 32-bit integer which is formed by assigning the host bits to all 0's and the networking bits to so many 1's.In this method, the subnetting separates the IP address between host and network addresses.The subnet mask covers an IP address with its 32-bit number, thus the term "mask".

Given:

Network IP address [tex]\bold{= 172.149.254.0 /24}[/tex]

Subnet numbers [tex]\bold{= 13}[/tex]

Calculating the borrow bits:

[tex]\to \bold{= ceil(\log_{2} 13) = 4 \ bits}[/tex]

a)

Calculating the dotted decimal value for the subnet mask:

[tex]\to \bold{11111111.11111111.11111111.00000000}\\\\\to \bold{255.255.255.240}\\\\[/tex]

b)

The additional bits which will be needed to mask the subnet mask that is = 4.

Learn more: brainly.com/question/2254014

Can someone compress this ipv6 address? 558c:0000:0000:d367:7c8e:1216:0000:66be

Answers

558c::d367:7c8e:1216:0:66be

Explain how/where could you change the NIC Card configuration from dynamic DHCP setting to an IP address of 10.254.1.42 with a subnet mask of 255.255.0.0 and a gateway of 10.254.0.1. (hint: we spoke about 2 different methods)

Answers

Answer:

Using the terminal in linux OS to configure a static ip address, gateway and subnet mask.

Explanation:

-Enter the terminal in the linux environment and use the ifconfig eth0 or -a to bring up the main network interface and other network interfaces.

- for static network configuration, use;

  - ifconfig eth0 10.254.1.42  

  - ifconfig eth0 netmask 255.255.0.0

  - ifconfig eth0 broadcast 10.254.255.255

- and add a default gateway with;

 -  route add default gw 10.254.0.1  eth0.

- Now verify the settings with the ifconfig eth0 command.

Windows workstations all have elements of server software built-in. What are these elements, and why is the Windows Professional OS not considered a server?

Answers

Answer:

The answer is below

Explanation:

Elements of Server software that is built-in, in Windows workstations are:

1. Hard drives,

2. RAM (Random Access Memory)

3. Processors

4. Network adapters.

Windows Professional OS is not considered a server due to the following:

1. Windows Professional OS has a limit on the number of client connections it allowed.

2. Unlike Server, Professional OS uses less memory

2. In comparison to Server, Professional OS uses the CPU less efficiently

4. Professional OS is not built to process background tasks, unlike Server that is configured to perform background tasks.

Cloud computing gives you the ability to expand and reduce resources according to your specific service requirement.

a. True
b. False

Answers

Answer:

a. True

Explanation:

Cloud computing can be defined as a type of computing that requires shared computing resources such as cloud storage (data storage), servers, computer power, and software over the internet rather than local servers and hard drives.

Generally, cloud computing offers individuals and businesses a fast, effective and efficient way of providing services.

In Computer science, one of the most essential characteristics or advantages of cloud computing is rapid elasticity.

By rapid elasticity, it simply means that cloud computing gives you the ability to expand and reduce resources according to your specific service requirement because resources such as servers can be used to execute a particular task and after completion, these resources can then be released or reduced.

Some of the examples of cloud computing are Google Slides, Google Drive, Dropbox, OneDrive etc.

subratract 11100 from 1011 by using 1's complement method step by step​

Answers

10089 is gonna be your anwser

Which of the following statements are true about the growth of technology? Select 3 options.
- The Number of devices connected to the internet of things is expected to triple between 2018 and 2023
- The general public began connecting to the internet when the World Wide Web was introduced in 1991
- Individuals in the United States currently own an average of three connected devices.
- By 1995, almost half of the world’s population was connected to the Internet
- Currently, 67% of people on earth use at least one mobile device

Answers

Answer:

1. Currently, 67% of people on earth use at least one mobile device.

2. The general public began connecting to the Internet when the World Wide    Web was introduced in 1991.

3. By 1995, almost half of the world’s population was connected to the Internet.

Explanation:

I just took the test ;)

Answer:

The correct answer :

-The general public began connecting to the Internet when the World Wide Web was introduced in 1991.

-The number of devices connected to the Internet of Things is expected to triple between 2018 and 2023.

-Currently, 67% of people on earth use at least one mobile device.

( not, By 1995, almost half of the world’s population was connected to the Internet. )

Explanation:

edge 2022

What is system software? Write its types.​

Answers

Answer:

There are two main types of software: systems software and application software. Systems software includes the programs that are dedicated to managing the computer itself, such as the operating system, file management utilities, and disk operating system (or DOS)

Answer:

There are two main types of software: systems software and application software. Systems software includes the programs that are dedicated to managing the computer itself, such as the operating system, file management utilities, and disk operating system (or DOS)

Explanation:

thanks for question

what is
computer.write its example

Answers

The definition of a computer is a person or electronic device that makes and stores quick calculations or processes information. An example of a famous human computer is Ada Lovelace. An example of a computer is the MacBook.

Select the scenario that describes a top-down approach to data warehouse design.


Cathy’s Cards and Gifts, which has three stores, creates data marts for its sales, marketing, and delivery departments to study the possibility of establishing a new store.


Crawford's Fabrics, which wants to expand its operations, combines data from the purchasing and sales departments into a central database, to be divided into new data marts as needed.


Cynthia’s Florals, which is dealing with debt, creates new data marts for the service, delivery, and sales departments to develop a strategy to stay in business.


Connor’s Meat Market, which just opened, creates data marts to track the sale of each of the following meats: beef, pork, lamb, and fish.

Answers

Answer:

Crawford's Fabrics, which wants to expand its operations, combines data from the purchasing and sales departments into a central database, to be divided into new data marts as needed.

The scenario defines a top-down approach to data warehouse design as "Crawford's Fabrics, which wants to expand its operations, combines data from the purchasing and sales departments into a central database, to be divided into new data marts as needed".

What is a top-down approach to data warehouse design?

In the "Top-Down" method system, a data warehouse exists defined as a subject-oriented, time-variant, non-volatile, and integrated data storage for the entire business data from various sources exist validated, reformatted, and saved in a normalized (up to 3NF) database as the data warehouse.

Therefore, the correct answer is option b) Crawford's Fabrics, which wants to expand its operations, combines data from the purchasing and sales departments into a central database, to be divided into new data marts as needed.

To learn more about warehouse design

https://brainly.com/question/25885061

#SPJ2

Implement the generator function scale(s, k), which yields elements of the given iterable s, scaled by k. As an extra challenge, try writing this function using a yield from statement!


def scale(s, k):


"""Yield elements of the iterable s scaled by a number k.


>>> s = scale([1, 5, 2], 5)


>>> type(s)



>>> list(s)


[5, 25, 10]


>>> m = scale(naturals(), 2)


>>> [next(m) for _ in range(5)]


[2, 4, 6, 8, 10]


"""

Answers

Answer:

The generator function using yield from:

def scale(s, k):

   yield from map(lambda x: x * k, s)

Another way to implement generator function that works same as above using only yield:

def scale(s, k):

  for i in s:

       yield i * k

Explanation:

The complete program is:

def scale(s, k):

   """Yield elements of the iterable s scaled by a number k.  

   >>> s = scale([1, 5, 2], 5)

   >>> type(s)

   <class 'generator'>

   >>> list(s)

   [5, 25, 10]  

   >>> m = scale(naturals(), 2)

   >>> [next(m) for _ in range(5)]

   [2, 4, 6, 8, 10]

   """

   yield from map(lambda x: x * k, s)

If you want to see the working of the above generator function scale() as per mentioned in the above comments, use the following statements :

s = scale([1, 5, 2], 5)  

print(type(s))  

#The above print statement outputs:

#<class 'generator'>

print(list(s))

#The above print statement outputs a list s with following items:

#[5, 25, 10]                                                                                                                    

The function def scale(s, k): is

def scale(s, k):

   yield from map(lambda x: x * k, s)    

This function takes two parameters i.e. s and k and this function yields elements of the given iterable s, scaled by k.

In this statement:    yield from map(lambda x: x * k, s)    

yield from is used which allows to refactor a generator in a simple way by splitting up generator into multiple generators.

The yield from is used inside the body of a generator function.

The lambda function is a function that has any number of arguments but can only have one expression. This expression is evaluated to an iterable from which an iterator will be extracted. This iterator yields and receives values to or from the caller of the generator. Here the expression is x: x * k and iterable is s. This expression multiplies each item to k.

map() method applies the defined function for each time in an iterable.

The generator function can also be defined as:

def scale(s, k):

  for i in s:

       yield i * k

For the above example

s = scale([1, 5, 2], 5)  

def scale(s,k): works as follows:

s = [1, 5, 2]

k = 5

for loop iterates for each item i in iterable s and yields i*k

i*k multiplies each element i.e 1,5 and 2 to k=5 and returns a list

At first iteration, for example, i*k = 1 * 5 = 5, next iteration i*k = 5*5 = 25 and last iteration i*k = 2*5 = 10. So the output. So

s = scale([1, 5, 2], 5)  In this statement now s contains 5, 25 and 10

print(list(s))  prints the values of s in a list as: [5, 25, 10] So output is:

[5, 25, 10]

Assign decoded_tweet with user_tweet, replacing any occurrence of 'TTYL' with 'talk to you later'.Sample output with input: 'Gotta go. I will TTYL.'Gotta go. I will talk to you later.code given:user_tweet = input()decoded_tweet = ''' Your solution goes here '''print(decoded_tweet)

Answers

Answer:

Here is the Python program:

user_tweet = input()

decoded_tweet = user_tweet.replace('TTYL', 'talk to you later')

print(decoded_tweet)

Explanation:

The program works as follows:

Suppose the input is:    'Gotta go. I will TTYL'

This is stored in user_tweet. So

user_tweet = 'Gotta go. I will TTYL'

The statement: user_tweet.replace('TTYL', 'talk to you later')  uses replace() method which is used to replace a specified string i.e. TTYL with another specified string i.e. talk to you later in the string stored in user_tweet.

The first argument of this method replace() is the string or phrase that is to be replaced and the second argument is the string or phrase that is to replace that specified string in first argument.

So this new string is assigned to decoded_tweet, after replacing 'TTYL' with 'talk to you later' in user_tweet.

So the print statement print(decoded_tweet) displays that new string.

Hence the output is:

Gotta go. I will talk to you later.

As an ICT student teacher using convincing and cogent reasons explain why you think operating system is pivotal in teaching and learning

Answers

Answer:

An operating system (OS) is a software which is responsible for the management of computer hardware, software, and also provides common services for computer programs.

Operating System is pivotal in teaching and learning because:

1. It enables computer programs to run smoothly on various computer devices.

2. The Operating System gives teachers the opportunity to install learning apps on their devices for ease of teaching.

3. It enables students to download and install learning applications, download and upload assignments, etc.

4. The Operating System makes video conferencing for online tuition easy and smooth.

5. It makes computer users to interact with other applications and softwares within a device.

Operating systems are found on many computer devices e.g: mobile phones, video games, PCs, supercomputers, etc.

The invention of the integrated circuit was the first major advance in computing. The integrated circuit made it possible for all of a computer's electrical components to reside on one silicon chip.

This invention became known as the __________.


personal computer


microprocessor


client-server configuration


mainframe computer

Answers

Answer:

micro processor

Explanation:

Suppose we have 999 records of employees Emp1, Emp2, Emp5, Emp6 and so on up to Emp998 and Emp999 stored in a sequence. Hence, records are nothing but a row in the table. In the employee table, we want to insert new records Emp3 and Emp4 in the sequence, and once we have done insertion we need to update and retrieve the record efficiently to optimize the performance of a database by minimizing the access time when query is being executed.

You are required to solve the problem with the index sequential access method with pros and cons in the given scenario

Answers

The records in the table represents the employee ID of each employee. Assume the table name is EMPLOYEES and the field name of employee IDs is ID, the following SQL query inserts Emp3 and Emp4 into the employees table.

INSERT INTO EMPLOYEES (ID) values (Emp3), (Emp4)

The advantage of using ISAM is that priorities are given to the indices of the records being inserted. So, Emp3 and Emp4 will be inserted immediately after Emp2.

However, a major disadvantage of using ISAM is that it is very expensive to keep the indices in a sequential order;

See attachment for the illustration of Index sequential access method (ISAM).

Read more about Index sequential access method (ISAM) at:

https://brainly.com/question/4692093

During the name resolution process, which technique is used to avoid congestion when querying a server

Answers

Answer:

"NOT lookup " is the correct approach.

Explanation:

This methodology significantly reduces the quantity of congestion of DNS messages on a certain file. The application establishes that whenever a question reaches if it is processed. Unless the file is loaded, then perhaps the response is returned with the cached cache.Typically the name resolution occurs in something like a DNS File. The conversion usually occurs throughout this cycle from Username to IP, including IP via Username.

You have n warehouses and n shops. At each warehouse, a truck is loaded with enough goods to supply one shop. There are m roads, each going from a warehouse to a shop, and driving along the ith road takes d i hours, where d i is an integer. Design a polynomial time algorithm to send the trucks to the shops, minimising the time until all shops are supplied.

Answers

Following are the steps of the polynomial-time algorithm:

Split the routes according to their categorizationAssuming that mid = di of the middle road, low = road with the least di, and high = road with the highest di, we may do a binary search on the sorted list.All shops must be approachable only using these roads for every road, from low to mid.Check if all shops can be reached from[tex]\bold{ low \ to\ mid+1}[/tex] using only these roads.There is a solution if every shop can be reached by road only up to [tex]\bold{mid+1}[/tex], but not up to mid.You can [tex]\bold{set \ low = mid+1}[/tex] if all businesses aren't accessible using both [tex]\bold{mid\ and\ mid+1}[/tex] roads.If every shop could be reached using both mid and mid+1, then set high to mid-1.With these layouts of businesses and roads, no response can be given because [tex]\bold{ low > high}[/tex]You can do this by [tex]\bold{set\ mid = \frac{(low + high)}{2}}[/tex]The new low, mid, and high numbers are used in step (a).

In a minimum amount of time, this algorithm will determine the best strategy to supply all shops.

Learn more:

polynomial-time algorithm: brainly.com/question/20261998

Write the following numbers in binary. 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 46. 55. 61.​

Answers

0 1 10 11
Explanaition:

When the code that follows is executed, a message is displayed if the value the user entersvar userEntry = (prompt("Enter cost:");if (isNaN(userEntry) || userEntry > 500 ) { alert ("Message");a. isn’t a number or the value in userEntry is more than 500b. isn’t a number and the value in userEntry is more than 500c. is a number or the value in userEntry is more than 500d. is a number and the value in userEntry is more than 500

Answers

Answer:

The answer is "Option b".

Explanation:

In the given-code variable "userEntry" is defined that prompt the user to input value and in the next step, the conditional statement is used, which checks the input value is not a number and greater than 500 with use of OR operator. if the condition is true it uses the alert box to print the message, that's why in this question except "choice b" all were wrong.

All of the following are extra precautions you can take to secure a wireless network EXCEPT ________. change your network name (SSID) enable SSID broadcast turn on security protocols create a passphrase

Answers

Answer:

Enable SSID broadcast

Explanation:

All of the following are extra precautions you can take to secure a wireless network except enable SSID broadcast. The correct option is B.

What is SSID broadcast?

When people in the area try to join their wireless devices, the name of your network is listed in the list of available networks thanks to broadcasting the SSID.

You can stop SSID broadcasting if you don't want arbitrary wireless devices attempting to connect to your network.

Home networks don't need to have a visible SSID unless they have many access points that devices can switch between.

If your network just has a single router, disabling this function means giving up the ease of adding new home network customers in exchange for certain security gains.

Apart from enabling SSID broadcast, there are other security measures you may take to protect a wireless network.

Thus, the correct option is B.

For more details regarding SSID broadcast, visit:

https://brainly.com/question/13191413

#SPJ6

Write an INSERT statement that adds this row to the Categories table:

CategoryName: Brass
Code the INSERT statement so SQL Server automatically generates the value for the CategoryID column.

Answers

Answer:

INSERT INTO categories (CategoryName)

VALUES ('Brass Code');

Explanation:

The SQL refers to the Structured Query Language in which the data is to be designed and maintained that occurred in the relational database management system i.e it is to be used for maintaining and query the database

Now the INSERT statement should be written as follows

INSERT INTO categories (CategoryName)

VALUES ('Brass Code');

Write a program that uses input to prompt a user for their name and then welcomes them. Note that input will pop up a dialog box. Enter Sarah in the pop-up box when you are prompted so your output will match the desired output.

Answers

user_name = str (input = ("Please enter your name: "))

def greet (user_name):

print ("Welcome to your ghetto, {0}!".format(user_name) )

What is the importance of using Onedrive in Windows 10 and how knowledge of it will have an impact in today's workplace?

Answers

The importance of one drive in windows 10 is that it helps the user to synchronize files in their computer.

Onedrive is a cloud storage system that is useful for the storage of files in a secured manner. A person can easily access their files whenever they want to.

In todays workplace a knowledge of onedrive has a great impact because

Onedrive offers an unlimited access to files whenever they are neededThe files can be available and accessed from anywhereIt helps with the organization of files in the work place.

One drive allows for this to be done even when offline. When online, there is an automatic synchronization of the made changes.

Read more at https://brainly.com/question/17163678?referrer=searchResults

Windows 10's one drive is useful because it enables users to synchronize information among various computers.Onedrive is indeed a cloud storage solution that can be used to store data in a secure environment.The user gets easy access to their files when their desire.In today's workplace, knowing how to use OneDrive is necessary because it gives unrestricted access to files anytime they're needed.The information can be transferred anywhere at.It assists with the arrangement of files in the workplace.It can be done and if you're not linked to the Network. Once you're online, the modifications you've performed are synchronized immediately.

Learn more:

brainly.com/question/24369537

a_____________ may have its value change during program execution. options. flowchart,counter, Algorithm,None of them​

Answers

Answer:

i think is "none of them"

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();

}

Answers

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      

what are the different versions of Ms word?​

Answers

Answer:

ms paint will not attend as the ICRC is the time to move becuse to get free skin on your skin that you have a doubt about the quality and

Select the true statement about the motherboard.


It executes the commands sent to it by the application software.


It acts as a storage point for read-only memory (ROM).


It acts as the working memory of the computer by transferring data from the hard disk for processing.


It provides much of the electrical connection between different computer parts.

Answers

Answer:

it executes the commands sent to it by the applica software .

The motherboard provides much of the electrical connection between different computer parts.

What is a motherboard?

This is known to be a kind of  printed circuit board that is made up of some key parts or aspect of a computer or any kind of device.

Conclusively, it is one that is made up of It connectors that is a place where other circuit boards can be placed and as such act to provides much of the electrical connection between different computer parts.

Learn more about motherboard from

https://brainly.com/question/12795887

#SPJ2

Other Questions
Write the quadratic function f(x) = x2 - 2x - 8 in factored form.A) f(x) =(x - 4)(x - 2)B) f(x) =(x + 4)(x - 2)C) f(x) =(x - 4)(x + 2)D) Rx) =(x + 4)(x + 2) When and where were the Illustrated Books made? If the geometric mean of a and 120 is 60, find the value of a. Write the equation of the line of best fit using the slope-intercept formula y = mx + b. Show all your work, including the points used to determine the slope and how the equation was determined. Es una tradicin espiritual que se centra en el desarrollo personal a travs de la meditacin. A. el islam B. el protestantismo C. el judasmo D. el budismo Pls help me Pls help me Team sports help teach adolescents and teens accountability, dedication and leadership true fasle Calvin has 80 meters of fencing to enclose his rectangular garden. He wants the gardens length to be 12 meters greater then its width. Find the length and width of the garden.a) 12m x 28mb) 14m x 26mc) 12m x 24md) 18m x 22mPls help! Frederick Griffith of Griffith's department stores tells his marketing director that he is tired of the constant price-centered advertising by the firm's agency. "We have the best customer service in town, and I feel that is what we should be hanging our hats on," he states. This statement is most appropriate for use in which of the following stages of campaign development? A) Determining the appropriations B) Creating the platform C) Identifying the target D) Defining objectives E) Developing the media plan Employees in your organization regularly need to print sensitive documents. The employees properly dispose of the hard copies of these documents. How can you ensure that electronic copies of these documents are not leaked to unauthorized users after the documents are printed Starting at the same spot on a circular track that is 80 meters in diameter, Hillary and Eugene run in opposite directions, at 300 meters per minute and 240 meters per minute, respectively. They run for 50 minutes. What distance separates Hillary and Eugene when they finish 5-_=4 pls help....... James is having a BBQ. Burgers come in packs of 12and buns come in packs of 8. How many packs of eachwill James need to buy so that he has no spares? The process called substrate cycling is used to describe this process: Group of answer choices Freely reversible reactions Recycling of vitamins as catalysts in metabolism Situations where there are two different enzymes used to reverse a specific step in a metabolic pathway Lines a and b are parallel. If the slope of line a is , what is the slope of line b? A.-B.4C.D.-4 What is the type of conjunction in the sentence, "while in the snow and ice, the goat is able to move up and down with ease" Use the drop-down menus to complete the sentences. The only way to prevent people from contracting both curable and incurable STIs that is effective 100 percent of the time is with__________ . The risk of contracting hepatitis is lowered when a person receives_________ . are protective barriers used to reduce the risk of contracting an STI. Pls help me with this.. Thank you!! See the pic How much percentage of population belongs to indo-european In its third year, a project is expected to produce earnings before interest and taxes of $671,551 and depreciation expense of $125,193. If the companys tax rate is 34%, what is the projects expected operating cash flow?