Coding problem! please review my work!
Part 1: Design a Class

You’ll design a class named Car that has the following fields:


yearModel—An Integer that holds the car’s year model

make—A String that holds the make of the car

speed—An Integer that holds the car’s current speed

The class should have the following constructor and other methods:


The constructor should accept the car’s year model and make as arguments. These values should be assigned to the object’s yearModel and make fields. The constructor should also assign 0 to the speed field.

Design appropriate accessor methods to get the values stored in an object’s yearModel, make, and speed fields.

The accelerate method should add 5 to the speed field each time it’s called.

The brake method should subtract 5 from the speed field each time it’s called.
--------------------------------------------------------------------------------------------
my coding (its in pseudocode!)

Class Car

Private Integer yearModel
Private String make
Private Integer speed

// Constructor
Public Module Car(Integer y, String m)
Set yearModel = y
Set make = m
Set speed = 0

End Module

// Accessors
Public Function Integer getYearModel()
Return yearModel
End Function

Public Function String getMake()
Return make
End Function

Public Function Integer getSpeed()
Return speed
End Function

// Mutators

Public Module accelerate()
Set speed = speed + 5
End Module

Public Module brake()
Set speed = speed - 5
End Module

End Class
---------------------------------------------------------------------------------------------
Part 2: Design a Program
You’ll create both pseudocode and a flowchart to design a program that creates a Car object and then calls the accelerate method five times.

Review Appendices B and C in your textbook for guidance when working on your project. Use free trials of any of the programs listed in CSC105 Graded Project 1 to create the flowchart. Write your pseudocode in a plain-text editor such as Notepad or TextEdit and save as a text file (*.txt).

After each call to the accelerate method, get the current speed of the car and display it.
Then, call the brake method five times. After each call to the brake method, get the current speed of the car and display it.
----------------------------------------------------------------------------------------------
My coding (its in pseudocode)

Module Main()

// Create a new car object
Set car = new Car(2022, "Tesla")

Call accelerate(5)

End Module

Module accelerate(Interger times)
If times > 0 Then
Display " The car has increased its speed by 5"
Display "The vehicle's current speed is " + speed; getSpeed()
Call accelerate (times - 1)
End if
End Module

Module Main()
Call brake(5)
End Module

Module brake (Interger times)
If times > 0 Then
Display " The cars brake has been Increased by 5"
Display "The vehicle's current speed is " + speed; getSpeed()
Call brake(times - 1)
End If
End Module
----------------------------------------------------------------
Thank you!

Answers

Answer 1

In the code above, It would be wise to ensure that the yearModel parameter in the Car class constructor is not a negative value, as it is illogical for a car to have a negative year.

What is the Class?

Checking that the speed does not drop below zero is important while using the accelerate and brake techniques because negative speed is illogical in the case of a car.

The accelerate technique in the code does not require an input specifying the frequency of acceleration. Instead of going through the trouble of multiple steps, simply increase the speed field by 5 every time the method is invoked.

Learn more about Class from

https://brainly.com/question/30804126

#SPJ1

Coding Problem! Please Review My Work!Part 1: Design A ClassYoull Design A Class Named Car That Has The

Related Questions

2. What simple trick would make the bit string–based algorithm generate subsets in squashed order?

Answers

To make the bit string-based algorithm generate subsets in squashed order, you can implement a Gray code sequence. Gray code is a binary numeral system where two successive values differ by only one bit. This ensures that subsets generated by the algorithm will have a smaller difference, leading to a squashed order.

In the context of generating subsets, the Gray code helps to produce combinations with minimal changes between each step. Instead of flipping multiple bits at once, you only need to change one bit at a time. This provides a more efficient and systematic way to explore the subsets, reducing the likelihood of duplicated work or missing a subset.

To apply Gray code to the bit string-based algorithm, follow these steps:

1. Start with an n-bit binary string initialized to all zeros.
2. Generate the next Gray code in the sequence by inverting a single bit.
3. Convert the Gray code string into a subset by including the elements with corresponding '1' bits.
4. Repeat steps 2-3 until all possible Gray code combinations are generated.

By using Gray code, you can achieve a simple trick to generate subsets in a squashed order, making the algorithm more efficient and easier to analyze.

You can learn more about algorithms at: brainly.com/question/22984934

#SPJ11

Vishing attacks are false warnings, often contained in email messages claiming to come from the it department. (ch-2) question 15 options: true false

Answers

False. Vishing attacks are false warnings, often contained in email messages claiming to come from the it department.

What are Vishing attacks

Vishing attacks (or "voice phishing") are a type of social engineering attack in which an attacker uses phone calls or Voice over IP (VoIP) services to deceive victims into providing sensitive information or taking specific actions. Vishing does not use emails as its main form of manipulation; rather it relies on voice communication as its primary means for manipulation.

This type of attack, in which false warnings from IT departments appear in emails that purport to come from them, is more accurately termed phishing.

Read more on Vishing attacks here:https://brainly.com/question/31459396

#SPJ4

One day you dash into the library to check your email. Before you can log in your phone chimes and you see a text message from your email provider. The text message contains a code for two-factor _____________

Answers

One day you dash into the library to check your email. Before you can log in your phone chimes and you see a text message from your email provider. The text message contains a code for two-factor authentication. Two-factor authentication is widely used to protect sensitive information and prevent unauthorized access to online accounts.

Two-factor authentication is a security measure that requires two forms of identification before granting access to an account or service. The first factor is typically a password, and the second factor can be something like a code sent to a phone number or email address, a fingerprint, or a security key. By requiring two factors of authentication, the security of the account is increased because an attacker would need to have access to both factors in order to gain unauthorized access.

To learn more about authentication; https://brainly.com/question/13615355

#SPJ11

Need help being allowed into this MC YT Server need to know this:
When was Techno's channel made:

A: April 4, 2016
B: October 28, 2013
C: January 7 2017
D: March 25, 2013

Answers

Answer:

b is the answer

Explanation:

assume that it is right

Made when he was 14

by 2020 he was 21

And it is right

Hope u get it right

B is the answer

BLOG
How To Fix This Build Of Vanguard Is Out Of Compliance With Current System Settings Error

Answers

The error message "This build of Vanguard is out of compliance with current system settings" typically occurs when the anti-cheat software, Vanguard, used by games like Valorant, detects an issue with the system configuration. Here are some steps to fix this error:

1. Update your Windows operating system: Make sure that your Windows is up to date with the latest versions and security patches. To do this, go to Settings > Update & Security > Windows Update and click on the Check for Updates button.

2. Update your graphics card driver: Make sure that your graphics card drivers are up to date. Visit the website of your graphics card manufacturer and download the latest drivers for your graphics card.

3. Restart your computer: Restarting your computer can sometimes help to resolve the issue.

4. Disable any overclocking software: Vanguard may not work correctly with overclocked hardware. Disable any overclocking software that you may have installed and try launching the game again.

5. Uninstall and reinstall Vanguard: If the above steps don't work, try uninstalling and reinstalling Vanguard. To do this, go to Add or Remove Programs in your Windows settings and uninstall the Riot Vanguard program. Then, restart your computer and try reinstalling Vanguard from the game client.

If none of the above steps work, you may need to contact the game support team for further assistance.

Deducing a rate law from initial reaction rate data.

Answers

Deducing a rate law from initial reaction rate data involves analyzing the relationship between the initial rates of a reaction and the concentrations of the reactants.

The rate law expresses the rate of the reaction as a function of the concentrations of the reactants and can be determined by comparing the initial rates of the reaction at different reactant concentrations.

To deduce the rate law, one first needs to perform a series of experiments where the initial concentrations of the reactants are systematically varied while all other conditions are kept constant. The initial rates of the reaction are then measured and recorded. The data can then be used to calculate the order of the reaction with respect to each reactant.

The order of the reaction with respect to a given reactant is determined by analyzing the effect of changes in the concentration of that reactant on the initial rate of the reaction.

If doubling the concentration of a reactant causes the initial rate to double, then the reaction is first order with respect to that reactant.

If doubling the concentration of a reactant causes the initial rate to quadruple, then the reaction is second order with respect to that reactant.

Once the order of the reaction with respect to each reactant is determined, the rate law can be written using the experimental data.

The rate law will typically have the form of Rate = k[A]^x[B]^y, where k is the rate constant, x and y are the orders of the reaction with respect to A and B, respectively, and [A] and [B] are the concentrations of A and B.

In conclusion, deducing a rate law from initial reaction rate data involves analyzing the relationship between the initial rates of a reaction and the concentrations of the reactants.

By systematically varying the concentrations of the reactants and analyzing the effect on the initial rate, the order of the reaction with respect to each reactant can be determined, and the rate law can be written using the experimental data.

Read more about Rate law at https://brainly.com/question/30379408

#SPJ11

you are the administrator for the westsim domain. organizational units (ous) have been created for each company department. user and computer accounts for each department have been moved into their respective department ous. computers in the accounting department use a custom application. during installation, the application creates a local group named acctmagic. this group is used to control access to the program. by default, the account used to install the application is made a member of the group. you install the application on each computer in the accounting department. all accounting users must be able to run the application on any computer in the department. you need to add each user as a member of the acctmagic group. you create a domain group named accounting and make each user a member of this group. you then create a gpo named acct software linked to the accounting ou. you need to define the restricted group settings. what should you do? answer create a restricted group named accounting. add the acctmagic group as a member. create a restricted group named acctmagic. add the accounting domain group as a member. create a restricted group named accounting. define the group as a member of the acctmagic group. create a restricted group named acctmagic. define the group as a member of the accounting domain group.

Answers

To ensure that all accounting users can run the custom application on any computer in the accounting department, you need to add each user as a member of the acct magic group. To accomplish this, you should create a domain group named accounting and add each accounting user as a member of this group.


After creating the accounting domain group, you should create a GPO named acct software and link it to the accounting OU. In this GPO, you need to define restricted group settings that will ensure that all accounting users are added to the acct magic group on each computer in the accounting department.

To do this, you should create a restricted group named accounting and add the acct magic group as a member. This will ensure that all accounting users are added to the acct magic group when they log in to any computer in the accounting department.

Alternatively, you could create a restricted group named acct magic and add the accounting domain group as a member. However, this approach is less efficient because it requires you to manually add the accounting domain group to each computer in the accounting department.

Overall, creating a restricted group named accounting and adding the acct magic group as a member is the most efficient and effective approach for ensuring that all accounting users can run the custom application on any computer in the accounting department.

For such more question on accounting

https://brainly.com/question/1033546

#SPJ11

Elias recorded a macro for formatting all of his data cells that include scientific number notation. After recording a long series of steps, he practices running the macro. Then he realizes that he meant to make all of these cells top-aligned instead of the default bottom-aligned.



What is the most efficient way for Elias to fix this macro?



A. Using the VBA editor, he could find every instance of "VerticalAlignment," and then change the text after the equal sign from "xlBottom" to "xlTop. "



B. Using the VBA editor, he could find every instance of "HorizontalAlignment," and then change the text after the equal sign from "xlBottom" to "xlTop. "



C. He could record the macro again, type in "xlBottom" to deactivate the default setting, and then select the top-align button under the Home tab.



D. He could record the macro again, select the bottom-align button under the Home tab to deactivate it, and then type in "xlTop" to trigger the correct setting

Answers

Using the VBA editor, he can find every instance of "VerticalAlignment" and change the text after the equal sign from "xlBottom" to "xlTop." This will efficiently update the macro to top-align the cells instead of bottom-aligning them. The correct option is A.

The VBA editor allows users to edit and modify recorded macros. In this case, Elias can use the editor to locate every instance of the "VerticalAlignment" setting in his recorded macro and change it to "xlTop" to align the cells to the top. This is more efficient than re-recording the macro as it saves time and ensures that all necessary changes are made.

Overall, option A is the most efficient way for Elias to fix his macro as it allows him to quickly update the necessary setting and ensure that his macro performs the desired function.

To know more about VBA editor visit:

https://brainly.com/question/29670993

#SPJ11

Hat is an example of value created through the use of deep learning?

Answers

One example of value created through the use of deep learning is the ability to automate complex tasks and processes that would be difficult or impossible for humans to perform manually.

Deep learning, a subfield of machine learning, uses artificial neural networks to process large amounts of data and learn from patterns and trends in that data. This technology has been applied to a wide range of industries and applications, from image and speech recognition to natural language processing and predictive analytics.

One notable example of value created through deep learning is in the field of medical imaging. Deep learning algorithms have been developed to analyze medical images and identify patterns and anomalies that may indicate the presence of disease or other medical conditions. This technology has the potential to improve the accuracy and speed of medical diagnoses, reduce the need for invasive procedures, and ultimately save lives.

Another example of value created through deep learning is in the field of natural language processing, where deep learning algorithms can be used to analyze and understand large volumes of written or spoken language. This technology has been applied to applications such as language translation, sentiment analysis, and chatbots, enabling more efficient and effective communication between humans and machines.

To learn more about Deep learning, visit:

https://brainly.com/question/24144920

#SPJ11

Write a C++ program that will perform the following sequence of the


operations :


A. Build 2 arrays ( Array_1 and Array_2 ). Array_1 consist of


10 random characters that are between a - p inclusive.


Array_2 consist of 10 random characters that are between L


- T inclusive. Display Array_1 followed Array_2 in 2 separate


lines.


B. Create new list ( Array_3 ) that contain all elements of


Array_1 and elements of Array_2. Display Array_3.


Array_3 is created according to the following rules :


Element 1 from Array_1 followed by element 1 from Array_2


followed by element 2 from Array_1 followed by element 2 from


Array_2 …. Etc.


C. Create a new array ( Array_4 ) by converting all lower-case


characters to upper case characters. Display Array_4.


D. Display the first character in Array_4 and then calculate and


display the number of occurrences of the first character in


Array_4.


E. Create a new array ( Array_5 ) by removing all duplicate


characters that are in Array_4. Display number of characters


in Array_5 and then Display Array_5.


F. Sort the characters in Arrays_5 in descending order from


highest to lowest. Display Array_5

Answers

This C++ program creates and manipulates character arrays according to the given rules, involving random character generation, combining arrays, converting characters to uppercase, counting occurrences, removing duplicates, and sorting in descending order.

To write a C++ program that performs the specified operations, follow these steps:

1. Include the necessary headers (iostream, ctime, and cctype) and use the std namespace.
2. Create two character arrays (Array_1 and Array_2) with a size of 10.
3. Generate random characters for Array_1 (between 'a' and 'p') and Array_2 (between 'L' and 'T'), using rand() and srand() functions.
4. Display Array_1 and Array_2 on separate lines.
5. Create Array_3 by combining Array_1 and Array_2 elements in the specified sequence.
6. Display Array_3.
7. Create Array_4 by converting all lowercase characters in Array_3 to uppercase using the toupper() function.
8. Display Array_4.
9. Find and display the first character in Array_4 and its number of occurrences.
10. Create Array_5 by removing duplicate characters from Array_4.
11. Display the number of characters in Array_5 and the array itself.
12. Sort the characters in Array_5 in descending order using any sorting algorithm (e.g., bubble sort or selection sort).
13. Display the sorted Array_5.

You can learn more about programs at: brainly.com/question/23866418

#SPJ11

Why should you check the spelling by reading a document even if you used writer's spell check feature?

Answers

it is always a good idea to check the spelling by reading a document even if you have used the writer's spell check feature. Doing so will help you catch any mistakes that may have been missed and ensure that the document is clear, concise, and professional.

Explanation:

While a writer's spell check feature is a useful tool for catching misspellings, it is not foolproof and may not catch all errors. Reading through a document after using the spell check feature allows you to catch any mistakes that may have been missed by the feature or any words that may have been spelled correctly but used incorrectly in the context of the sentence. Additionally, manually reviewing a document for spelling errors shows attention to detail and professionalism, which can enhance the overall impression of the written work.

However, this assumption can be dangerous, as the spell check feature is not perfect and can miss certain errors. For example, it may not catch homophones, which are words that sound the same but are spelled differently, such as "there" and "their."

Furthermore, the spell check feature may suggest incorrect corrections that do not fit the context of the sentence. For example, it may suggest changing "too" to "to" when "too" was the intended word. This can result in errors that may make the document appear unprofessional or confusing.

Reading through a document after using the spell check feature allows you to catch any mistakes that may have been missed by the feature. It also enables you to identify words that may have been spelled correctly but used incorrectly in the context of the sentence. For instance, "their" and "there" are both valid words but using the wrong one can change the meaning of a sentence.

In addition to catching errors, manually reviewing a document for spelling errors shows attention to detail and professionalism, which can enhance the overall impression of the written work. It also ensures that the document is error-free and easy to read, which is essential when communicating important information.

In summary, while a writer's spell check feature is a helpful tool, it is not foolproof, and it is always a good idea to manually review a document for spelling errors. Doing so will help you catch any mistakes that may have been missed and ensure that the document is clear, concise, and professional.

Know more about the spell check feature click here:

https://brainly.com/question/30150221

#SPJ11

CST 315 Network Security Group Project Due: 04-25-2020 (100 Points) This project is due on Sunday, April 25 at 11:59 p. M. Late submissions will be penalized by 10% per day. If you have a conflict due to travel, etc. , please plan accordingly and turn in your project early. In this project each group is to create a secure organization network. You are to implement a Local Area Network in CPT for the High-Tech Small Business Inc. The network should cover the two departments in the company (Marketing Department and Engineering Department). This project is to ensure that you can do the following: a. Deploy mobile devices securely b. Install and configure identity and access services c. Implement identity and access management controls Task to Perform Use at least 15 network devices including at least 5 IoT devices. Connect all devices and do the following for all devices: 1. Configure Usernames, Passwords (set minimum password length requirement) and Privilege Levels 2. Configure Service Password Encryption, Idle Time-Out, Login Blocking and a Banner 3. Configure Telnet Access and SSH Access 4. Configure a Switchport Port Security Deliverables: I. CPT File II. Screenshots of item 1-4 configurations

Answers

In this project, your goal is to create a secure organization network for High-Tech Small Business Inc., covering the Marketing and Engineering Departments.

Your task is to:

1. Deploy mobile devices securely
2. Install and configure identity and access services
3. Implement identity and access management controls

To accomplish this, you will use at least 15 network devices, including 5 IoT devices. For all devices, you need to configure:

1. Usernames, Passwords (with a minimum password length requirement), and Privilege Levels
2. Service Password Encryption, Idle Time-Out, Login Blocking, and a Banner
3. Telnet Access and SSH Access
4. Switchport Port Security

Your deliverables will include a CPT file and screenshots of the configurations for items 1-4. In 150 words, you will need to explain these configurations and how they contribute to a secure network. Remember to submit your project on time, as late submissions will be penalized by 10% per day.

You can learn more about the network at: brainly.com/question/1167985

#SPJ11

How many waddle dees are in kirby and the forgotten land.

Answers

As of now, the exact number of Waddle Dees in "Kirby and the Forgotten Land" is not specified since the game has not been released yet.

Waddle Dees are common characters in the Kirby series, serving as both friends and enemies

. In this upcoming game, we can expect to encounter various Waddle Dees throughout Kirby's adventure.

Once the game is released, we will have a better understanding of the number of Waddle Dees present in "Kirby and the Forgotten Land." Stay tuned for more information when the game becomes available.

Learn more about Kirby series at

https://brainly.com/question/15043670

#SPJ11

A very popular development technique used by database professionals for database design is known as ________. data models normalization entity-relationship data modeling database extraction

Answers

A very popular development technique used by database professionals for database design is known as "entity-relationship data modeling."

Entity-relationship data modeling is a technique used to design a database by creating a conceptual representation of the data and its relationships. It involves identifying the entities (objects or concepts) within a system and their relationships to one another.

This modeling technique helps to ensure that the database is designed to meet the needs of the end users and that it is efficient in storing and retrieving data.

Data models, normalization, and database extraction are also important techniques used in database design, but entity-relationship data modeling is one of the most widely used techniques.

For more questions like Database click the link below:

https://brainly.com/question/30634903

#SPJ11

Your boss at a software company gives you a binary classifier (i. E. , a classifier with only two possible output values) that predicts, for any basketball game, whether the home team will win or not. This classifier has a 28% accuracy, and your boss assigns you the task of improving that classifier, so that you get an accuracy that is better than 60%. How do you achieve that task

Answers

To improve the accuracy of the binary classifier for predicting the outcome of basketball games, we can collect more data, use different algorithms, hyperparameter tuning and feature engineering.



1. Collect more data: It is possible that the low accuracy of the classifier is due to insufficient data. Gathering more data can help improve the accuracy of the model.

2. Feature engineering: The accuracy of the binary classifier can be improved by engineering new features that better represent the data. This may involve combining or transforming existing features or adding new ones altogether.

3. Hyperparameter tuning: The classifier may have several hyperparameters that can be tuned to improve accuracy. This includes parameters such as learning rate, regularization, and number of iterations.

4. Use a different algorithm: If the current binary classifier is not performing well, it may be necessary to try a different algorithm. For example, if the current model is based on logistic regression, trying a decision tree or neural network may improve accuracy.

By implementing these steps, it should be possible to improve the accuracy of the binary classifier to a level above 60%.

To learn more about hyperparameters; https://brainly.com/question/29674909

#SPJ11

A customer comes into a computer parts and service store. The customer is looking for a device to manually input text for a new networking textbook that the customer is writing. What device should the store owner recommend to accomplish the required task?

Answers

Answer:

a keyboard. you use it every time you type text.

Explanation:

A keyboard is a device used to input text and commands into a computer or other device. It is a common peripheral device for desktop and laptop computers and is used extensively for word processing, internet browsing, and other tasks that require text input.

What two former soviet republics, now free, independent nation states, suffered cyber attacks from russia in 2007 and 2008

Answers

Estonia and Georgia are the two former Soviet republics that suffered cyber-attacks from Russia in 2007 and 2008, respectively.

In 2007, Estonia experienced a series of cyber-attacks targeting government, financial, and media websites, which were widely attributed to Russia. These attacks followed political tensions between the two countries over the relocation of a Soviet-era war memorial in Estonia's capital, Tallinn. The cyber-attacks, which involved Distributed Denial of Service (DDoS) and defacement of websites, disrupted essential services and had a significant impact on the country's digital infrastructure.

Similarly, in 2008, Georgia was targeted by cyber-attacks during its military conflict with Russia over the separatist regions of South Ossetia and Abkhazia. The attacks primarily targeted Georgian government websites, making it difficult for the government to communicate with citizens and the international community. The methods used in these attacks also included DDoS and website defacement. Some experts linked the cyber attacks to Russian hackers and government agencies, though concrete evidence was never officially presented.

Both incidents highlighted the vulnerabilities of national digital infrastructures and the potential for cyber warfare to be used as a tactic in international disputes. As a result, Estonia and Georgia have since invested in strengthening their cyber defense capabilities and have played an active role in promoting international cooperation on cyber security issues.

Know more about the cyber-attacks click here:

https://brainly.com/question/22255103

#SPJ11

Standard tools such as packagekit and ________ can obtain software packages and updates through a content distribution network provided by red hat.

Answers

Standard tools such as PackageKit and Yum can obtain software packages and updates through a content distribution network provided by Red Hat.

PackageKit and Yum are package management tools used in Red Hat-based Linux distributions. These tools help users install, update, and manage software packages on their systems. Red Hat provides a content distribution network (CDN) that allows these tools to access and retrieve software packages and updates efficiently from their repositories.

PackageKit and Yum are standard tools that work with Red Hat's content distribution network to obtain software packages and updates, making it easy for users to manage their Linux systems.

To know more about Linux systems visit:

https://brainly.com/question/28443923

#SPJ11

Kiara is doing a'report on corrections in the United States. She finds it interesting that part of the subculture that forms in prison includes prison argot. To what does this term refer? A. B. C. D. obtaining goods and services in prison a unique vocabulary used by prisoners a form of prison weapon a subculture that prisoners are introduced to ​

Answers

Kiara is doing a'report on corrections in the United States. She finds it interesting that part of the subculture that forms in prison includes prison argot. The term Prison Argot refers to the unique vocabular used by prisoners.

What is a Prison Argot?

Prison lingo is a colloquialism used mostly by criminals and inmates in correctional facilities. It is an example of anti-language. Many of the terminology are related to criminal activity, incarceration, court proceedings, street life, and various sorts of inmates. Prison jargon differs by institution, area, and nation.

Prison argot, often known as prison slang or prison jargon, is a language established inside the confines of correctional facilities. It is a specialized language comprised of terms and phrases specific to prison culture that are frequently used to describe various elements of life behind bars.

Learn more about prison argot at:

https://brainly.com/question/2663000

#SPJ1

Answer:

a unique vocabulary used by prisoners

Explanation:

I did it js trust me i got it wrong but now i got it right on my first attempt i got yall its b

Given main() and the instrument class, define a derived class, stringinstrument, for string instruments.
ex. if the input is:
drums
zildjian
2015
2500
guitar
gibson
2002
1200
6
19
the output is:
instrument information:
name: drums
manufacturer: zildjian
year built: 2015
cost: 2500
instrument information:
name: guitar
manufacturer: gibson
year built: 2002
cost: 1200
number of strings: 6
number of frets: 19
//main.cpp
#include "stringinstrument.h"
int main() {
instrument myinstrument;
stringinstrument mystringinstrument;
string instrumentname, manufacturername, stringinstrumentname, stringmanufacturer, yearbuilt,
cost, stringyearbuilt, stringcost, numstrings, numfrets;
getline(cin, instrumentname);
getline(cin, manufacturername);
getline(cin, yearbuilt);
getline(cin, cost);
getline(cin, stringinstrumentname);
getline(cin, stringmanufacturer);
getline(cin, stringyearbuilt);
getline(cin, stringcost);
getline(cin, numstrings);
getline(cin, numfrets);
myinstrument.setname(instrumentname);
myinstrument.setmanufacturer(manufacturername);
myinstrument.setyearbuilt(yearbuilt);
myinstrument.setcost(cost);
myinstrument.printinfo();
mystringinstrument.setname(stringinstrumentname);
mystringinstrument.setmanufacturer(stringmanufacturer);
mystringinstrument.setyearbuilt(stringyearbuilt);
mystringinstrument.setcost(stringcost);
mystringinstrument.setnumofstrings(numstrings);
mystringinstrument.setnumoffrets(numfrets);
mystringinstrument.printinfo();
cout << " number of strings: " << mystringinstrument.getnumofstrings() << endl;
cout << " number of frets: " << mystringinstrument.getnumoffrets() << endl;
}
//instrument.h
#ifndef instrumenth
#define instrumenth
#include
#include
using namespace std;
class instrument {
protected:
string instrumentname;
string instrumentmanufacturer;
string yearbuilt;
string cost;
public:
void setname(string username);
string getname();
void setmanufacturer(string usermanufacturer);
string getmanufacturer();
void setyearbuilt(string useryearbuilt);
string getyearbuilt();
void setcost(string usercost);
string getcost();
void printinfo();
};
#endif
//instrument.cpp
#include "instrument.h"
void instrument::setname(string username) {
instrumentname = username;
}
string instrument::getname() {
return instrumentname;
}
void instrument::setmanufacturer(string usermanufacturer) {
instrumentmanufacturer = usermanufacturer;
}
string instrument::getmanufacturer() {
return instrumentmanufacturer;
}
void instrument::setyearbuilt(string useryearbuilt) {
yearbuilt = useryearbuilt;
}
string instrument::getyearbuilt() {
return yearbuilt;
}
void instrument::setcost(string usercost) {
cost = usercost;
}
string instrument::getcost() {
return cost;
}
void instrument::printinfo() {
cout << "instrument information: " << endl;
cout << " name: " << instrumentname << endl;
cout << " manufacturer: " << instrumentmanufacturer << endl;
cout << " year built: " << yearbuilt << endl;
cout << " cost: " << cost << endl;
}
//stringinstrument.h
#ifndef str_instrumenth
#define str_instrumenth
#include "instrument.h"
class stringinstrument : public instrument {
// todo: declare private data members: numstrings, numfrets
// todo: declare mutator functions -
// setnumofstrings(), setnumoffrets()
// todo: declare accessor functions -
// getnumofstrings(), getnumoffrets()
};
#endif
//stringinstrument.cpp
#include "stringinstrument.h"
// todo: define mutator functions -
// setnumofstrings(), setnumoffrets()
// todo: define accessor functions -
// getnumofstrings(), getnumoffrets()

Answers

The code defines a derived class, stringinstrument, from a base class, instrument, which represents various musical instruments and their properties.

What is the purpose of the given code, and what does it do?

The given code requires the creation of a derived class, stringinstrument, that inherits from the base class, instrument.

The derived class must include private data members for the number of strings and number of frets, as well as mutator and accessor functions for these data members.

The main function prompts the user to input information about an instrument and a string instrument, which are then printed out using the printinfo function for each class.

The derived class specific information, number of strings and number of frets, are printed separately.

To create the stringinstrument class, the private data members and mutator and accessor functions must be defined in the stringinstrument.h and stringinstrument.cpp files.

Learn more about code

brainly.com/question/31228987

#SPJ11

Abby has always dreamed of having her own ice cream shop. Now as a young entrepreneur she has decided to pursue her dream, but she needs some help in determining the financial viability of her plan. She has come up with a list of income and expense parameters and needs a simple program to input these parameters and calculate the monthly profit or loss as well as performing some variable cost what-if analysis.



For expenses, she has:



Raw ingredient cost per serving


Hourly labor rate


Real estate monthly rental


Utilities per month


Monthly advertising budget


On the income side, she has:



Selling price per serving (assume only one size for simplicity)


Number of servings sold per month


Based on some research, she has determined that a single employee can run the shop and she plans to have the shop open eight hours per day and six days per week.



Best Practices to Follow:



Write detailed comments and doc-strings.


Use logical variable names with a consistent convention.


Organize and structure your code for readability.


Use hand calculations to verify the formulas in your code. I. E. Write your own test cases to check correctness.


Create the text-based, menu interface



Write a Python script with a menu driven, text-based user interface that looks like this:



Expenses:


1. Cost per serving: 1. 0


2. Labor rate per hour: 7. 5


3. Shop rental per month: 800


4. Utilities per month: 150


5. Advertising budget per month: 100



Income:


6. Selling price (each): 4. 0


7. Servings sold per month: 500

Answers

it will display a menu with the current values for expenses and income. You can choose to modify any of these values or quit the program. If you modify a value,

What are some best practices to follow when writing the Python script?

Sure, I can help you with that! Here's a Python script that should do what you're asking for:

```python

def calculate_profit_loss(expenses, income, servings):

   """

   Calculates the profit or loss based on the given expenses, income, and number of servings sold.

   """

   revenue = income * servings

   cost_of_goods_sold = expenses['raw_ingredient_cost'] * servings

   labor_cost = expenses['hourly_labor_rate'] * 8 * 6 * 4

   total_expenses = cost_of_goods_sold + labor_cost + expenses['rental_cost'] + expenses['utilities_cost'] + expenses['advertising_budget']

   profit_loss = revenue - total_expenses

   return profit_loss

def perform_what_if_analysis(expenses, income, servings):

   """

   Performs a what-if analysis on the given expenses, income, and number of servings sold.

   """

   print("What-if analysis:")

   print("=================")

   for i in range(1, 6):

       new_expenses = expenses.copy()

       new_expenses[list(expenses.keys())[i-1]] *= 1.1  # Increase the selected expense by 10%

       new_profit_loss = calculate_profit_loss(new_expenses, income, servings)

       print(f"If {list(expenses.keys())[i-1]} increases by 10%, profit/loss will be: {new_profit_loss:.2f}")

   print()

def main():

   # Set default values for expenses and income

   expenses = {

       'raw_ingredient_cost': 1.0,

       'hourly_labor_rate': 7.5,

       'rental_cost': 800,

       'utilities_cost': 150,

       'advertising_budget': 100

   }

   income = 4.0

   servings = 500

   # Loop for the menu

   while True:

       # Print the menu

       print("Ice Cream Shop Profit Calculator\n")

       print("Expenses:")

       for i, expense in enumerate(expenses.items()):

           print(f"{i+1}. {expense[0].replace('_', ' ').title()}: {expense[1]:.2f}")

       print("\nIncome:")

       print(f"6. Selling price per serving: {income:.2f}")

       print(f"7. Number of servings sold per month: {servings}\n")

       # Ask the user to choose an option

       choice = input("Enter an option (1-7), or 'q' to quit: ")

       if choice == 'q':

           break

       elif choice == '6':

           income = float(input("Enter the new selling price: "))

       elif choice == '7':

           servings = int(input("Enter the new number of servings sold per month: "))

       elif choice in ['1', '2', '3', '4', '5']:

           expense_name = list(expenses.keys())[int(choice)-1]

           new_expense = float(input(f"Enter the new {expense_name.replace('_', ' ').title()}: "))

           expenses[expense_name] = new_expense

       # Calculate and print the profit/loss

       profit_loss = calculate_profit_loss(expenses, income, servings)

       print(f"\nProfit/Loss: {profit_loss:.2f}\n")

       # Perform a what-if analysis

       perform_what_if_analysis(expenses, income, servings)

if __name__ == '__main__':

   main()

```

When you run the script, it will display a menu with the current values for expenses and income. You can choose to modify any of these values or quit the program. If you modify a value,

Learn more about Current values

brainly.com/question/30880193

#SPJ11

Does anyone know how to do these exercises on python computing, on the for and while topic:

1. (exercise for)

create a program that prompts the user for a number between 1 and 10, inclusive.
inclusive.
as many times as indicated by the number entered by the user, the program should, using the
for statement:
ask the user to enter a string.
using the for statement, print the string letter by letter downwards, uppercase the
letters, and the numbers multiplied by two.
for example, if the user enters a 2, and enters the following data that we see in bold type, the
program should display a result similar to the following:
enter a string: hy78
h
y
14
16
enter a string: 2m4nb6
4
m
8
n
b
12

2. (exercise while)

create a result variable, which will initially be worth 0.
with the help of the while, continuously perform the following tasks:
ask the user for a number.
ask the user for an operation, which can be +, -, x or /.
if the user has entered the + operation, the program will add the number to the contents of the
the previous operation.
if instead the user has entered the operation -, the program will subtract the number from the
if the user has entered the - operation instead, the program will subtract the number from the contents of the previous operation.
if instead the user has entered the operation x, the program will multiply the number
by the contents of the previous operation.
if instead the user has entered the operation /, the program will divide the contents of
if the user has entered the operation /, the program will divide the contents of the previous operation by the number entered.
print the statement "the result of applying the operation [variable with operation] by the number [variable with accumulated result before
number [variable with accumulated result before the operation] and [variable with
number entered by user] is [variable with accumulated result after the operation].
operation]
if you want to continue. if the user enters no, the program will terminate.
when finished, the program will display the result of having performed all operations.

Answers

For the first exercise using the for loop in Python, we need to prompt the user to enter a number between 1 and 10, inclusive. Using the input() function, we can read the user input and store it in a variable. Next, we will use the range() function to loop through the inputted number of times.

Within each iteration of the loop, we will ask the user to enter a string and store it in a variable. Then, using a nested for loop, we can loop through each character in the string and apply the required modifications such as converting to uppercase and multiplying the numbers by 2. Finally, we can print the modified string to the console.

For the second exercise using the while loop, we need to continuously ask the user for a number and an operation. We can use a while loop with a condition that checks if the user has entered "no" to terminate the loop. Within each iteration, we can store the user input in separate variables and perform the appropriate operation based on the operator entered.

We also need to keep track of the accumulated result and update it with each operation. Finally, we can print the result statement using string formatting and display the final result after all operations have been performed. It is important to handle any potential errors such as dividing by zero or entering an invalid operator.

You can learn more about Python at: brainly.com/question/30427047

#SPJ11

Kaylie is writing a program to determine the largest number in a list of numbers. She comes up with the following algorithm. Step 1: Create a variable max and initialize it to 0 0. Step 2: Iterate through the list of integer values. Step 3: Of an element's value is larger than max, set max equal to that element's value. What one change can Kaylie make that will allow this program to work for all lists

Answers

To make this program work for all lists, Kaylie should change the initialization of the max variable in Step 1. Instead of initializing it to 0, she should initialize it to the first element in the list. This ensures that the maximum value is initially set to a valid value in the list, and the algorithm will work even if the list contains only negative numbers.

For example, if the list contains [5, -3, 8, -2], initializing max to 0 will result in the wrong output, as all the values in the list are greater than 0. However, if Kaylie initializes max to the first element (5), the algorithm will correctly identify the maximum value (8) in the list.

By making this change, Kaylie's program will be able to handle any list of integers, regardless of the values in the list. This will make the program more robust and reliable, ensuring that it always provides the correct output.

You can learn more about the program at: brainly.com/question/23866418

#SPJ11

Assume that you are given both the preorder and postorder traversal of some binary tree t. Prove that this information, taken together, is not necessarily sufficient to reconstruct t uniquely, even if each value in t occurs only once

Answers

The information from both the preorder and postorder traversal of a binary tree T is not necessarily sufficient to reconstruct T uniquely, even if each value in T occurs only once.


1. Preorder traversal visits nodes in the order: root, left subtree, and right subtree.
2. Postorder traversal visits nodes in the order: left subtree, right subtree, and root.

Let's consider an example to show that the preorder and postorder traversals do not uniquely identify a binary tree:

Example:
Tree 1:
   A
  / \
 B   C

Preorder traversal: A, B, C
Postorder traversal: B, C, A

Tree 2:
   A
  / \
 C   B

Preorder traversal: A, C, B
Postorder traversal: C, B, A

In this example, we can see that the preorder and postorder traversals are not enough to distinguish between Tree 1 and Tree 2, even though each value occurs only once in each tree. This is because the information about the relationship between the left and right subtrees is lost during the traversals, making it impossible to uniquely reconstruct the original tree.

Based on the example, we can conclude that having both the preorder and postorder traversals of a binary tree is not sufficient to uniquely reconstruct the tree, even if each value occurs only once. Additional information, such as inorder traversal, would be needed to uniquely reconstruct the binary tree.

To know more about binary tree visit:

https://brainly.com/question/13152677

#SPJ11

Please help complete Excel (screenshot below) by using the steps below. Ty!
Start Excel. Download and open the file named EXP19_Excel_Ch08_HOEAssessment_RobertsFlooring.xlsx. Grader has automatically added your last name to the beginning of the filename.
You would like to use the Data Analysis ToolPak to create a histogram to visualize the data. To complete this task, first ensure the Data Analysis ToolPak is active. Next, use the histogram feature in the Data Analysis ToolPak to place a histogram in the worksheet. Use the range C3:C13 as the Input Range. Use the range F3:F10 as the Bin range. Place the output in cell F13. Be sure to check Labels, Cumulative Percentage, and Chart Output. Position the Chart Output so that the upper left corner starts just inside the borders of cell F23.
You would like to add a linear trendline to a scatter plot to help better forecast pricing based on square footage of the installation space. You will position the chart to start in cell K3, place the sqft data in the X axis, the Cost data in the Y axis, and add a trendline with equation and R-square. Be sure to add a descriptive chart title (Price Forecast).
You would like to use the FORECAST.LINEAR function to calculate a cost estimate to install 1500 sqft of flooring. Be sure to use the cost data as the known_ys and the Sqft data as the known_xs. Place the formula in cell I4.
Create a footer with your name on the left side, the sheet name code in the center, and the file name code on the right side.
Save and close EXP_Excel_CH08_HOEAssessment_RobertsFlooring.xlsx. Exit Excel. Submit the file as directed.

Answers

To complete the Excel assessment, follow the steps below:

1. Start Excel and download/open the file named EXP19_Excel_Ch08_HOEAssessment_RobertsFlooring.xlsx. Grader has automatically added your last name to the beginning of the filename.

2. Activate the Data Analysis ToolPak to create a histogram to visualize the data. Use the histogram feature in the Data Analysis ToolPak to place a histogram in the worksheet. Use the range C3:C13 as the Input Range. Use the range F3:F10 as the Bin range. Place the output in cell F13. Be sure to check Labels, Cumulative Percentage, and Chart Output. Position the Chart Output so that the upper left corner starts just inside the borders of cell F23.

3. Add a linear trendline to a scatter plot to help better forecast pricing based on square footage of the installation space. Position the chart to start in cell K3, place the sqft data in the X axis, the Cost data in the Y axis, and add a trendline with equation and R-square. Be sure to add a descriptive chart title (Price Forecast).

4. Use the FORECAST.LINEAR function to calculate a cost estimate to install 1500 sqft of flooring. Be sure to use the cost data as the known_ys and the Sqft data as the known_xs. Place the formula in cell I4.

5. Create a footer with your name on the left side, the sheet name code in the center, and the file name code on the right side.

6. Save and close EXP_Excel_CH08_HOEAssessment_RobertsFlooring.xlsx. Exit Excel. Submit the file as directed.

Learn more about assessment here:

https://brainly.com/question/28046286

#SPJ11

Question 4 of 20
most applications will ask you to provide all of the following information
except
a. the date you can start work
b. the dates and hours you are available to work.
c. your desired salary or wage.
d. which of your previous jobs you didn't like.

Answers

Most applications will ask you to provide all of the following information except (d) which of your previous jobs you didn't like. The correct option is D.

Job applications typically require information such as your availability to start work, your preferred work schedule, and your desired salary or wage, as these are relevant to the employer's needs and decision-making process. However, they do not generally ask for personal opinions or preferences about previous jobs, as this is not relevant to the current application.

When filling out job applications, focus on providing the necessary information, such as your availability and desired compensation, and avoid discussing any negative experiences with previous jobs. The correct option is D.

To know more about decision-making process visit:

https://brainly.com/question/29772020

#SPJ11

What is a single letter, number, symbol, or punctuation mark known as?

Answers

A single letter, number, symbol, or punctuation mark is known as a "character". In computing, a character refers to a unit of information that represents a letter, digit, or other symbol used in written communication.

Each character has a unique code or representation that allows computers to process and display text in various languages and scripts. Characters are typically stored using a standardized encoding system, such as ASCII, Unicode, or UTF-8, which assigns a unique code to each character. The use of characters is essential for creating and processing data in various applications, including word processing, programming, and data analysis. It is important to note that characters can also be used to represent non-textual information, such as control codes or graphics, in digital communication.

To learn more about computing; https://brainly.com/question/26972068

#SPJ11

True/False: Functions are ideal for use in menu-drive programs. When a user selects a menu item, the program can call an appropriate function to carry out the user's choice

Answers

"True/False: Functions are ideal for use in menu-driven programs. When a user selects a menu item, the program can call an appropriate function to carry out the user's choice" is true.

Functions are a fundamental building block of programming, and they are particularly useful in menu-driven programs. When a user selects a menu item, the program can call a specific function to carry out the user's choice.

This makes it easy to organize the code, simplify the logic, and make the program more readable and maintainable. By separating the program's different functionalities into functions, it is also easier to debug, test, and modify the code.

Overall, functions are an ideal tool for implementing menu-driven programs, as they provide a modular, structured, and efficient way to manage the program's different functionalities.

For more questions like Code click the link below:

https://brainly.com/question/31228987

#SPJ11

consider the switch shown below. suppose that all packets have the same fixed length and it requires one time slot to transfer a packet from an input port to an output port for all switching fabric. assume the switch fabric is a crossbar (more details in chapter 4.2 in the book) so that at most one packet can be transferred to a given output port in a time slot, but different output ports can receive packets from different input ports in a single time slot. what is the minimal number of time slots needed to transfer the packets shown from input ports to their output ports. instead, if the switching fabric is a bus, what is the minimum number of time slots required to transfer all the packets. explain your answer.

Answers

In a crossbar switch, two time slots are the absolute minimum needed for packet transfers, but four slots are needed in a bus. This is so because a bus can only transfer one packet at a time, whereas a crossbar can transfer numerous packets concurrently.

Which of these three switching fabric types are used in routers?

Switching through memory, switching through a bus, and switching through a network of connections are the three methods of switching.

What is the capacity of a switching fabric?

Switch Fabric Capacity: This term often refers to the fastest rate at which hardware can transfer data between cards or ports. Since the vendors count full duplex, the Switch Fabric Capacity is typically double what it actually is and is expressed in bits per second (bps).

To know more about time slots visit:

https://brainly.com/question/30000870

#SPJ1

Build a budget using a spreadsheet. Suppose you're a senior in high school and you need to continue to save for college tuition. You'll need to include income, expenses, and savings in your personal budget. Open a spreadsheet and follow these steps to populate your spreadsheet. Enter labels, Month, Projected Income, Estimated Expenses, and Savings in cells A2, B2, C2, and D2. Enter the months October through August in cells A3 through A13. Use a shortcut. Enter the following data for your income.


Use the spreadsheet to calculate the totals for the following expenses. There is no need to label the type of expenses in the spreadsheet. Just add the numbers together and list as a lump sum for each month.


At the beginning of October, you had $5600 in your savings account. Enter a formula in column D to show the amount you have in savings each month. Assume all of the money that you don't spend goes into your savings account.


Estimate the answer and check the data and formulas

Answers

To build a budget using a spreadsheet, create labels for Month, Projected Income, Estimated Expenses, and Savings in cells A2, B2, C2, and D2. Enter the months October through August in cells A3 through A13 and use a shortcut.

Then enter data for income, calculate the total expenses, and use a formula to calculate the amount in savings each month.

To populate a spreadsheet for a personal budget, it is important to include labels for each category and enter the appropriate data for each month. Calculating the total expenses for each month can help identify areas where spending can be reduced.

Using a formula to calculate the amount in savings each month helps track progress towards financial goals, such as saving for college tuition. Checking the data and formulas ensures the accuracy and reliability of the budget.

For more questions like Amount click the link below:

https://brainly.com/question/13024617

#SPJ11

Other Questions
What was the purpose behind the publication of the 1840 illustration above?. Sleep ran from me for what seemed like forever. Can someone please draw me a Federation timeline, I have attached a photo of the significant dates that should be in it. Please and thank you :) 4. By analyzing the italicized text from Mr. Gibson's reactions toBirdie in line 25 and to Lizzie in line 44 of "Mr. Gibson's Flivver,"you can conclude that Explain two similarities shared by mining and oil wells in KS? For the same procedure described in the chemical equilibrium lab handout for determining k, 15.0 ml of organic solution was added to 71.0 ml of ki aqueous solution at 307.25 k. both the aqueous and organic solutions were prepared at 298.15 k with the apparent concentration of 0.0716 m for the i-(aq) and 0.0044 for the i2(org) solutions, respectively. after mixing these immiscible solutions, the final concentration of i2 in the organic layer was determined to be 0.00077 m through uv-vis spectroscopy. in a separate experiment, the partition coefficient was found to be k = 0.046 at 301.56k.required:a. determine the approximate equilibrium constant, k without making any temperature correctionb. what is the percentage enor for using the non- corrected k rather than the corrected k? Let g(x.y)= 15x2 +2y2. Compute g(3,3), g(0,-2), and g(a,b). g(3,3)= _____ What could be the Solution to the Russia-Ukraine war Which of the following distinguishes the main concern over legislation that would make electronic identification systems for livestock mandatory?The electronic identification systems disrupt the livestocks neuropathy.The electronic identification systems are invasive and painful.The electronic identification systems will not track diseases and contamination.The electronic identification systems are too expensive for small farms. A shoe store donated a percent of every sale to charity. The total sales were $7,200 so the store donated $144. What percent of $7,200 was donated to charity? What is the numerical expression that represents the sun of eight squared and thirty two if a1=5 and an=an-1 -1 then find the value of a4 24. 51 mL of acetic acid, HC2H3O2, of unknown concentration was titrated with the 12. 6 mL of 0. 497 M Ba(OH)2 to reach the equivalence point. Determine the concentration of the acetic acid. 2HC2H3O2 + Ba(OH)2 Ba(C2H3O2)2 + 2H2OA. 0. 223 MB. 0. 836 MC. 0. 359 MD. 0. 511 ME. 0. 979 M 2Which of the following is the best summary of the passage?OA. Gregory is reading a book, and he begins to feel like a detective. He and his sister Laura are tryingto solve a mystery at their home. Their mother calls and helps them solve the mystery, and Gregorystops feeling like a detective.OB. A strange man appears outside a house and begins to water the lawn. The man has a beard, andthe people who live in the house learn that he is the gardener. He pushes a wheelbarrow andwaves at the people who are in the house.OC. Gregory sees a strange man outside his window while he is reading a detective novel. He and hissister Laura are scared. Before he calls 911, their mother calls, and they learn that the man is thegardener.OD. A strange man appears outside Gregory and Laura's house. Laura hugs Gregory's waist becauseshe is frightened. At first, Gregory thinks the neighbor's dog is chasing a cat, but he learns who theman is when he answers the phone. Find the equation of a line that goes throught point -2,-5 and is parallel to y = x + 2 The Unit 3 Exam. 31. Compare the extent and impact of external interactions, such as trade or migration, onSub-Saharan Africa and the Americas. To what extent did those external influences affectthe integration of each region into broader networks of trade? Which tennis tournament banned russian and belarusian players from competing this summer?. write an algorithm that deletes a node from a binary search tree considering all possible cases. analyze your algorithm and show the results using order notation How does adeline garcia describe indians who found themselves stranded at the downtown seattle bus depot Read the prompt then type the answer in the box. The interview with Eileen Collins and the article "First All Female Space Walk" both focus on women breaking barriers as astronauts. What events and evidence does each author focus on when relating information about female astronauts?2. Read the prompt then type your answer in the box. Consider the Newsela article "Opinion: From embarrassed about bicultural identity, to celebrating it. " Discuss how the people and their ideas interact in the text. Use textual evidence to support your response