Write the c++ program that will take the following arguments:a.Name (figure type): diamond, trapeze, circle, rectangle
b.Subsequent parameters required to calculate fields and perimeters of the particular figures (for each one they are different!)and will print on the screen results of calculations. For each figure the separate function should be created.
It should be selected based on the name of the figure (with the switch..case structure)

Answers

Answer 1

Using the knowledge in computational language in C++it is possible subsequent parameters required to calculate fields and perimeters of the particular figures

Writting the code:

def Diamond(rows):

   n = 0

   for i in range(1, rows + 1):

       # loop to print spaces

       for j in range (1, (rows - i) + 1):

           print(end = " ")

       

       # loop to print star

       while n != (2 * i - 1):

           print("*", end = "")

           n = n + 1

       n = 0

       

       # line break

       print()

   k = 1

   n = 1

   for i in range(1, rows):

       # loop to print spaces

       for j in range (1, k + 1):

           print(end = " ")

       k = k + 1

       

       # loop to print star

       while n <= (2 * (rows - i) - 1):

           print("*", end = "")

           n = n + 1

       n = 1

       print()

See more about C++ at brainly.com/question/18502436

#SPJ1

Write The C++ Program That Will Take The Following Arguments:a.Name (figure Type): Diamond, Trapeze,

Related Questions

Using output devices you can:
Input data
Scan data
Store data
View or print data
None of these

Answers

Explanation:

Using output devices one can view, hear, print or get data.

all of the following are true of input data except? put all data fields together use some kind of formating to show that all data fields go together. they can be on a different sheet than the calculated fields they have to be on the same sheet as the calculated fields

Answers

It is a data type that the user has specified. Integer, float, char, string, and other forms of data are among them.

The assertion is untrue. The right answer is "A structure's fields are of different data kinds." A user-defined data type with one or more named attributes, each with its own data type, is referred to as a structured type. Properties that characterize a type instance are called attributes. For instance, a list of Cartesian coordinates could be one of the attributes of a geometric shape. One or more variables, maybe of various types, are grouped together and given a single name as a structure. It is a data type that the user has specified. Integer, float, char, string, and other forms of data are among them. As a result, the assertion is untrue.

Learn more about Structured type here:

https://brainly.com/question/29980987

#SPJ4

Now we are going to write our very first runnable JavaScript. Download a1.zip from D2L and extract the a1.html file. Rename it as a1_ Your FirstName.html. Inside the tags add the necessary JavaScript to create a word problem that includes a question and answer. • A sample word problem may look like: Q: John works for 34 weeks in a year and enjoys for the rest of the weeks. For how many weeks John enjoy? The next time the page loads, the numbers should change, so the problem may look like: assume 52 weeks in a year.
Q: John works for 26 weeks in a year and enjoys for rest of the weeks. For how many weeks John enjoy?
A: 26

Answers

To create a word problem that includes a question and answer in JavaScript, you can use the following code attached:

What is the coding  about?

The code above creates a variable called "weeksInYear" that is set to 52, which represents the total number of weeks in a year. It then creates a second variable called "weeksWorked" that is assigned a random number between 0 and 51 (since we're using the Math.floor function, the random number will be a whole number).

The "weeksEnjoyed" variable is calculated by subtracting "weeksWorked" from "weeksInYear" and this tells us the number of weeks that John is enjoying. A variable called "name" is also defined and set to "John", this is used to construct the question.

The question is written to the HTML document using the document.write() method. The question includes the number of weeks worked and the name of the person. The answer is written to the HTML document using the document.write() method as well.

Learn more about coding from

https://brainly.com/question/22654163

#SPJ1

After entering the sympathetic chain, preganglionic nerve fibers may do which of the following? Select all that apply.

Answers

Preganglionic nerve fibres may synapse with postganglionic neurons after entering the sympathetic chain, which will then deliver the impulse to a target organ or tissue.

The spinal cord's sympathetic chain, a network of nerves, is in charge of triggering the body's "fight or flight" reaction. Preganglionic nerve fibres are bundles of nerve cells in the sympathetic chain that emerge from the spinal cord and go to the sympathetic ganglia. The postganglionic nerve fibres that these fibres synaptically connect with subsequently move to the target organs to initiate the sympathetic response. Preganglionic nerve fibres have a variety of effects, such as speeding up heartbeat, widening pupils, and boosting blood flow to muscles. The sympathetic chain, in its entirety, is essential for triggering the body's reaction to stress or danger, preparing the body for physical activity or to defend against a potential threat.

To know more about Never fiber Please click on the given link:

https://brainly.com/question/29929000

#SPJ4

Where is an intrusion protection system usually placed?
Outside of the network
Between the company servers and the internet
Between users
After the company servers

Answers

Answer:

between the company's internal network and the internet

Explanation:

An intrusion protection system is usually placed between the company's internal network and the internet, to protect the network from external threats. This is known as a perimeter firewall

Write C program and use typedef to create a structure called twoDShape that contains
character arrays name[20], an integer numberOfEdges, and two float radius and
area. The program then reads a list of 2D shapes from the user (up to 10 shapes).
Remember a circle needs radius instead of edges.
Using a pointer shapePtr that points to the list of shapes, display the information back
to the users together with the area of the shape. For triangle you need to ask for values
of the height(h) and base(b), while for square and circle use your own common-sense.
Use the formula below for triangle. All values are of type float and π = 3.14159

Answers

#include <stdio.h>

typedef struct {

   char name[20];

   int numberOfEdges;

   float radius;

   float area;

} twoDShape;

int main() {

   twoDShape shapeList[10];

   twoDShape *shapePtr;

   shapePtr = shapeList;

   for (int i = 0; i < 10; i++) {

       printf("Enter name of shape: ");

       scanf("%s", shapePtr->name);

       printf("Enter number of edges (or -1 for a circle): ");

       scanf("%d", &shapePtr->numberOfEdges);

       if (shapePtr->numberOfEdges == -1) {

           printf("Enter radius of circle: ");

           scanf("%f", &shapePtr->radius);

           shapePtr->area = 3.14159 * (shapePtr->radius * shapePtr->radius);

       } else if (shapePtr->numberOfEdges == 3) {

           float h, b;

           printf("Enter value of height: ");

           scanf("%f", &h);

           printf("Enter value of base: ");

           scanf("%f", &b);

           shapePtr->area = (h * b) / 2;

       } else if (shapePtr->numberOfEdges == 4) {

           float l;

           printf("Enter value of length: ");

           scanf("%f", &l);

           shapePtr->area = l * l;

       }

       shapePtr++;

   }

   shapePtr = shapeList;

   for (int i = 0; i < 10; i++) {

       printf("Shape: %s\n", shapePtr->name);

       printf("Number of edges: %d\n", shapePtr->numberOfEdges);

       printf("Area: %f\n", shapePtr->area);

       shapePtr++;

   }

   return 0;

}

when this setting is enabled, this account can only access content that is appropriate for all audiences. additionally, communication settings will be set to off.
a. true
b. false

Answers

The second adage states that we must provide the appropriate quantity of information, neither more nor less.

According to H. Paul Grice, when we connect with other individuals, communication is successful because of the cooperative principle. To ensure that we are cooperating and have a mutual acceptance to interpret the other in a particular way, Grice devised a set of maxims. The first axiom states that we must tell the truth or anything that can be verified by facts. The second adage states that we must provide the appropriate quantity of information, neither more nor less. The third rule states that we must provide a response that is relevant to the topic at hand. The fourth rule is that we must express ourselves clearly.

Learn more about Communication  here:

https://brainly.com/question/17372112

#SPJ4

question 6 a data analyst reviews a database of wisconsin car sales to find the last car models sold in milwaukee in 2019. how can they sort and filter the data to return the last five cars sold at the top of their list? select all that apply.

Answers

By ranking a particular sorted column, the Sort Sheet is used to arrange all of the data in a spreadsheet.

In the column you wish to sort, choose a cell. Click Sort under the Sort & Filter group on the Data tab. Select the column you wish to sort by a custom list in the Sort dialogue box's Column section, under the "Sort by" or "Then by" box. Go to Order and choose Custom List. Placing items from a collection in some form of order is the process of sorting. A list of words, for instance, might be arranged alphabetically or by length. A list of cities might be sorted by region, zip code, or population.

To learn more about Sort Sheet click the link below:

brainly.com/question/28138049

#SPJ4

you are working in a spreadsheet and use the sumif function in the formula below as part of your analysis.Which part of this formula indicates the range of values to be added?O =SUMIFO E2:E10O >=50O D2:D10

Answers

These justifications are used in the formula: The range of cells to which the criteria should be applied is indicated by the necessary argument range.

Explain about the sumif function?

Only values that fulfil one set of criteria are added by the SUMIF function. Multiple numbers are added together by the SUMSQ function after each of them has undergone a square mathematical process. Only values that fulfil one set of conditions are counted using the COUNTIF function.

Using a true or false condition, the SUMIF function in Excel calculates the sum of the values in a range. Criteria are the requirements, and they might include things like: You can apply the criterion to one range and then add the appropriate numbers in another range if you'd like. If a number is greater than another number > If a number is less than another number

To learn more about sumif function refer to:

https://brainly.com/question/26965606

#SPJ4

When is it appropriate to save a file locally and When is it appropriate to save remotely ?

Answers

It is appropriate to save a fil elocally when:=

the file will be used primarily on a single device or computer, andthere is no need for the file to be accessed or edited by multiple users or devices, andthere is no need for a backup of the file in case the device or computer is lost or damaged.

When should you store remotely?

It is appropriate to save a file remotely when:

the file needs to be accessed or edited by multiple users or devices,there is a need for a backup of the file in case the device or computer is lost or damaged,you want to access the files from different location.

In general, it is best to save important or critical files remotely to ensure that they can be accessed and recovered in case of device failure or loss.

Read more about storage here:

https://brainly.com/question/24227720

#SPJ1

Which of the following tools can be used to determine if a network cable is good? Choose all that apply.
a. Cable tester
b. Crimper
c. Loopback plug
d. Network multimeter

Answers

A cable tester and a network multimeter can be used to determine if a network cable is good.

A network cable's quality can be checked using a number of tools. A cable tester is one of the most frequently used tools. In order to check for continuity and appropriate wiring, a cable tester is a device that attaches to both ends of a cable and transmits a signal across the cable. A multimeter, which can measure a cable's resistance and continuity, is another useful instrument. In addition, cable faults such open or short circuits can be measured length and location using a Time Domain Reflectometer (TDR). A network multimeter is a specific kind of multimeter that may be used to gauge the voltage, current, and resistance of a network cable, among other electrical characteristics. These tools are necessary for network technicians to check that cables are operating correctly and to spot and resolve any potential problems.

To know more about network

brainly.com/question/13102717

#SPJ4

Your company plans to run large scale image analysis and processing in Azure.

You need to recommend which Azure compute service to use for the planned solution. The solution must minimize administrative effort.

Which Azure service should you recommend?

Select only one answer.

Azure Batch

Azure Functions

Azure Logic Apps

Azure virtual machines

Answers

The Azure service that should be recommended is A. Azure Batch.

What is Azure Batch ?

Azure Batch enables large-scale parallel and high-performance computing (HPC) batch jobs to be run in Azure with a minimum of administrative effort.

It can run jobs on virtual machines (VMs) that are provided and managed by Azure, and can scale out to thousands of VMs if needed. This makes it ideal for image analysis and processing, which can require significant computing power and resources.

Azure virtual machines can be used for running applications in the cloud, but may require more administrative effort for managing the VMs and scaling them as needed.

Find out more on Azure Batch at https://brainly.com/question/29907647

#SPJ1

programming assignment: create a program searchnewbooks.cc that given as command line input newbooks.dat and request.dat and a method of search either binary or linear, creates a file of the number of books found from the request list $searchnewbooks newbooks.dat request.dat //run program $choice of search method ([l]inear, [b]inary, [r]ecursivebinary)? b cpu time: 10.777 microseconds $cat found.dat 1

Answers

This program is designed to search for books from a given list and a request list.

What is program?

It takes two command line arguments: newbooks.dat which contains the list of books, and request.dat which contains the list of books to search for. It also takes a method of search, either linear, binary or recursive binary. The program then searches the list of books in newbooks.dat and finds the books from the request list in request.dat. It then creates a file called found.dat which contains the number of books found from the request list.

The program starts by reading in the two files and storing the data in data structures. It then checks the user's choice of search method and performs the appropriate search. If the user chooses linear search, the program will iterate through the list of books until it finds the requested book. If the user chooses binary search, the program will first sort the list of books, then use a binary search algorithm to find the requested book. If the user chooses recursive binary search, the program will use a recursive binary search algorithm to find the requested book.

Once the requested book is found, the program will increment a counter that keeps track of the number of books found. The program will also keep track of the CPU time used for the search. Finally, the program will output the number of books found and the CPU time used to found.dat.

In summary, this program is designed to search a list of books and find the requested books from a request list. It takes two files, newbooks.dat and request.dat, and a search method as command line input. It then creates a file called found.dat which contains the number of books found from the request list and the CPU time used.

To learn more about program
https://brainly.com/question/27359435
#SPJ4

Which type of list is most approprite for giving instructions on how to build a bird
house?
Bucket List
Numbered List
Bulleted List
Marked check list

Answers

Use a bulleted list for unordered items; use a numbered list for ordered items.

What is bulleted list?A bulleted list is an unordered list of items where every item has a graphical bullet. The bullets may be characters of different fonts, as well as graphical icons.Bulleted lists help the author structure the text in a better way - provide a list of application components, list of usage scenarios, etc. When the order of elements is not important and you don't need to refer to a list element later in the text, it's good to use bulleted lists. They help avoid the perception of the elements order importance.When the order of elements is important (instruction steps, list of itemns ordered by importance), you can use a numbered list instead.

To learn more about bulleted list refer to:

https://brainly.com/question/26707368

#SPJ1

Month-end postings to control accounts in a computerized accounting system are not required because
a. control accounts are not used in computerized systems
b. transactions are posted to accounts immediately
c. transactions are posted at the end of the financial year
d. the input operator can choose to post to accounts at any time

Answers

The correct answer is b. transactions are posted to accounts immediately. Month-end postings to control accounts in a computerized accounting system are not required .

Moving all transactions from all Journals (transaction registers) to the Chart of Accounts is referred to as the "Post Transactions Process" (General Ledger). Moving a transaction or several transactions from a module into a Journal is sometimes referred to as "posting." The account that is debited is posted on the account's debit side, while the account that is credited is recorded on the account's credit side. Throughout the year, this procedure is followed, and at the conclusion of the fiscal year, the ledger accounts are closed, tallied, and balanced.

To learn more about accounts click the link below:

brainly.com/question/22917325

#SPJ4

true or false an integer and float can be argument?

Answers

Answer: TRUE

Explanation:

An integer and a float can both be arguments in a function or method. They are both considered numerical data types in programming, and can be used in mathematical operations.

help, describe a typical Consultants relationship of change

like an it consultant and how they deal with change and how often things change​

Answers

A consultant's relationship with change is often characterized by a high degree of flexibility. They are typically able to quickly adjust to new situations and rapidly adapt to changing conditions. They are often comfortable with the idea of change, and are able to quickly identify and analyze potential changes in the environment. They are also often able to anticipate changes in the environment and adjust their strategies accordingly. Consultants are also often able to provide valuable insight into how changes may affect their clients, as well as how to best manage and implement those changes. In addition, consultants are often comfortable with the idea of change and are able to quickly identify and analyze potential changes in the environment.

Prasana has been hired by a book author to listen to record interviews and type them into documents. what is her job?
A: Transcriptionist
B: Data entry clerk
C: Writer
D: Receptionist

Answers

The solution is option A, or transcriptionist, based on the facts provided in the question.

What does a clerk who enters data do?

Refreshing the database by including up-to-date information about customers and accounts. source data is organized by gathering and sorting data to get it ready for computer entry. establishes the order of entries. By checking the data for errors, customer and accounts source documents are processed.

How can someone without experience begin data entry?

You require a high school graduation or the equivalent, together with the capacity to exhibit attention to detail, to work as a clerk for data entry without prior experience. Without prior expertise, employers recruit data entry clerks and train people on the data tools they use.

To know more about Data entry clerk visit:

https://brainly.com/question/14856993

#SPJ1

Which of the following actions is NON-DESTRUCTIVE? CHOOSE TWO.

Everything in the Layer > Adjustments menu
The Clone Stamp tool
Converting to Grayscale
Changing the Opacity of a layer
Everything in the Adjustments panel

Answers

The following actions are non-destructive:

Everything in the Layer > Adjustments menu.

These adjustments can be made to a single layer without affecting the underlying layers. This means that you can edit the adjustments or remove them entirely without altering the original image data.

Changing the Opacity of a layer

When you change the opacity of a layer, it simply reduces the visibility of that layer but the original image data is still retained.

The Clone Stamp tool, which is used to copy pixels from one area of an image to another, can be destructive because it overwrites the original pixels.

Converting to Grayscale also discards the color information, which is considered a destructive action.

Everything in the Adjustments panel is not a valid option because it includes both destructive and non-destructive adjustments.

Ursa Major Solar needs to fulfill the following requirements:
A custom object must be created to capture account survey data.
Users need the ability to select an account from the survey record and view related surveys on the account record.
Which two actions can an administrator configure to meet these requirements?
Choose 2 options.

Answers

1. To collect data from the account survey, create a custom object.

2. Set up a lookup relationship between the custom object and the account object to allow users to choose an account from the survey record and view associated surveys on the account record.

To collect account survey data, an administrator can construct a custom object in Ursa Major Solar. The date of the survey, the results, and survey comments are just a few possible fields for this custom object. In order to enable users to read related surveys on the account record, the administrator can also establish a relationship between the custom object and the account object. Lookup relationship a user can choose an account from the survey record and view related surveys on the account record by configuring a lookup relationship between the account object and the custom object. Users will be able to examine all surveys linked to a certain account thanks to this, making it simpler to follow survey data and take wise decisions. The administrator can also configure options for filtering and sorting to make it easier for users to identify the pertinent surveys fast.

To know more about Ursa Major Solar Please click on the link:

https://brainly.com/question/30112327

#SPJ4

Prepare Mounthly Payroll to xy Company which Calculate Tax, Pension Allowance, over time and Vet for each employce​

Answers

Make a payroll calculation using ADP® Payroll. Get 3 Months of Payroll Free! ADP® Payroll makes the payroll process quicker and simpler. Get ADP® Payroll Started Today! Time and presence. IRS tax deductions.

How do you calculate Monthly Payroll ?

You're ready to determine the employee's pay and the amount of taxes that must be deducted once you've set up your employees (and your firm, too). Making appropriate deductions for things like health insurance, retirement benefits, or garnishments, and, if necessary, adding back reimbursements for expenses. Going from gross compensation to net pay is the technical word for this.

Feel free to jump to the step you're searching for if you're having trouble understanding a particular one: First, determine your gross pay. Step 2: Determine the employee tax with holdings for 2019 or earlier and 2020 or later. Add any expense reimbursements in step four. Step 5: Compile everything.

To learn more about Payroll refer to :

https://brainly.com/question/30086703

#SPJ1

ink-jet printers produce text and graphics in both black-and-white and color on a variety of paper types.

Answers

On a range of paper types, ink-jet printers output text and images in both black and white and colour.

What is a printer?

A printer is a device that receives text and graphic output from a computer and prints the data on paper, typically on sheets of paper that are standard size, 8.5" by 11".

Ink-jet printers produce text and images in both black and white and colour on a variety of paper types.

Pixels are used to measure how bright an LCD monitor or LCD screen is. When a ribbon with ink is struck by small wire pins on a print head mechanism in a laser printer, printed images are created.

Thus, it is true that ink-jet printers produce text and graphics in both black-and-white and color on a variety of paper types.

For more details regarding printer, visit:

https://brainly.com/question/17136779

#SPJ1

Automatic Updates Of Applications
There's a constant race between hackers, who try to find vulnerabilities in software, and developers, who
work to fix vulnerabilities and improve overall security. This race leads to a steady stream of updates
offered for various operating systems and applications. One way to protect your computer from attack is
to make sure your own applications are as up to date as possible, and modern operating systems offer a
way to automate your updates.
Search online using a phrase like "activate automatic updates for applications to find out how to activate
automatic updates for applications for your preferred OS: Windows OS, Mac OS X, or Linux.
1. Explain how to activate automatic updates for that system's applications (or how to verify that
automatic updates are turned on). Be sure to name the OS you are using for your answer, and
provide a link to the web page where you found your answer.

Answers

Activate the automatic app updates. To access the Store, choose Store from the Start screen. Tap Settings after sliding in from the right edge of the screen.

How do I make System programs update automatically?

The Start screen's Store option should be chosen. In the upper right corner of the Microsoft Store, choose the account menu (the three dots), and then choose Settings. Under App updates, turn on Update apps automatically.

Why is it crucial to have software update automatically?

To fix vulnerabilities detected in an application, piece of software, or operating system, developers publish updates. Automatic updates can assist in plugging security gaps that nefarious actors attempt to exploit.

To know more about automatic visit:-

https://brainly.com/question/29556906

#SPJ1

how can i make money while i sleep?

Answers

Answer:

look below

Explanation:

you can make money while you sleep by starting a business that is fully automated by your employees (preferably online) so you don’t have to do any work. it should be online because people from different time zones can order your products.

An unordered list can use one of four different bullet options: disc, square, circle, or triangle.
TRUE OR FALSE

Answers

False. An unordered list can use different types of bullet options, but the specific options you mentioned (disc, square, circle, triangle) are not the only possible options. Unordered list bullet styles can vary depending on the specific implementation and the medium in which they are used (e.g. HTML, CSS, Word Processing software), but the common bullet styles are bullet point, circle and square.

Identify the examples of goals. Select three options

Answers

1. To increase company profits by 10% over the next quarter

2. To run a marathon in under 4 hours

3. To become fluent in French within the next year

Three notable developments of artificial intelligence in the 3rdgeneration

Answers

Answer:

1. National security

AI plays a substantial role in national defense. Through its Project Maven, the American military is deploying AI “to sift through the massive troves of data and video captured by surveillance and then alert human analysts of patterns or when there is abnormal or suspicious activity.” According to Deputy Secretary of Defense Patrick Shanahan, the goal of emerging technologies in this area is “to meet our warfighters’ needs and to increase [the] speed and agility [of] technology development and procurement.”

2. Criminal justice

AI is being deployed in the criminal justice area. The city of Chicago has developed an AI-driven “Strategic Subject List” that analyzes people who have been arrested for their risk of becoming future perpetrators. It ranks 400,000 people on a scale of 0 to 500, using items such as age, criminal activity, victimization, drug arrest records, and gang affiliation. In looking at the data, analysts found that youth is a strong predictor of violence, being a shooting victim is associated with becoming a future perpetrator, gang affiliation has little predictive value, and drug arrests are not significantly associated with future criminal activity.

3. Transportation

Transportation represents an area where AI and machine learning are producing major innovations. Research by Cameron Kerry and Jack Karsten of the Brookings Institution has found that over $80 billion was invested in autonomous vehicle technology between August 2014 and June 2017. Those investments include applications both for autonomous driving and the core technologies vital to that sector.

Rajee has been assigned by her computer science teacher to create an animation to change the text "I am a
Good photoshop editor" into "I will soon screen a movie like AVATAR" How should she proceed?

Answers

Creating animation frames in Photoshop is done using the Timeline panel. A configuration of layers is shown by each frame. Remarkably, a timeline and keyframes can also be used to produce animations.

Is it better to animate in Photoshop or Adobe animate?

It depends on the kind of animation you want to make. Photoshop is a fantastic choice if you want to make 2D animations. Animate is a better option if you wish to make 3D animations. You may utilize Adobe Photoshop's video editing features to create appealing marketing videos.

Adobe Animate CC is a Good Program for New Users .For those who are new to creating animations, movies, or interactive material, Adobe Animate CC is a fantastic tool. It provides a user-friendly interface and strong features that make it simple to produce beautiful frame-by-frame animations. Actually, the earliest animation tool to show continuous movement was the phenakistoscope. It functions similarly to film and creates the illusion of motion by using the persistence of vision principle.

To learn more about Photoshop editor refer to :

https://brainly.com/question/16859761

#SPJ1

Will mark brainliest if correct!
Code to be written in python

A deferred annuity is an annuity which delays its payouts. This means that the payouts do not start until after a certain duration. Notice that a deferred annuity is just a deposit at the start, followed by an annuity. Your task is to define a Higher-order Function that returns a function that takes in a given interest rate and outputs the amount of money that is left in a deferred annuity.

Define a function new_balance(principal, gap, payout, duration) that returns a single-parameter function which takes in a monthly interest rate and outputs the balance in a deferred annuity. gap is the duration in months before the first payment, payout is monthly and duration is just the total number of payouts.

Hint: Note that duration specifies the number of payouts after the deferment, and not the total duration of the deferred annuity. You are NOT ALLOWED to use string formatting and YOU SHOULD USE previous definitions of deposit and balance to answer this question!

def new_balance(principal, gap, payout, duration):
# Complete the function
return

Definitions of previous functions deposit and balance:

def deposit(principal, interest, duration):
total = principal * ((1+ interest )** duration)
return total

def balance(principal, interest, payout, duration):
for i in range(duration): #iterating for duration number of times
principal = principal*(1+interest) #compounding the principat
principal = principal-payout #subtracting payout from principal
return principal

How to run your code?
# e.g.
# test_balance = new_balance(1000, 2, 100, 2)
# result = test_balance(0.1)

Test Case:
new_balance(1000, 2, 100, 2)(0.1)
output: 1121.0

Answers

Using the knowledge in computational language in python it is possible define a function new_balance that returns a single-parameter function which takes in a monthly interest rate and outputs the balance in a deferred annuity.

Writting the code:

def new_balance(principal, gap, payout, duration):

'''

Function to calculate the balance in a deferred annuity.

principal: the amount deposited at the start

gap: the duration in months before the first payment

payout: monthly payout

duration: the number of payouts after the deferment

'''

# define the inner function

def balance(rate):

 '''

 Function to calculate the balance, given the monthly interest rate

 '''

 # first calculate the interest earned during the deferment period

 interest = principal * (1 + rate) ** gap - principal

# then calculate the balance after the first payout

 balance = interest + principal - payout

# then loop through the remaining payouts, calculating the balance after each one

 for i in range(duration - 1):

  balance = balance * (1 + rate) - payout

 # finally, return the balance

 return balance

return balance

test_balance = new_balance(1000, 2, 100, 2)

result = test_balance(0.1)

print("{:.1f}".format(result))

See more about python at brainly.com/question/18502436

#SPJ1

John is having trouble keeping track of his daily school schedule. His teacher suggested printing it out where it would be easily readable. Which option would best orgainze the data?

Answers

Answer: A table or chart format would likely be the best option. This format would allow John to easily read and understand the information, and quickly find the information he needs. Another option could be a calendar format, it allows him to see the entire month at a glance and would be helpful in keeping track of deadlines, assignments and test dates. ✅

Explanation:

Other Questions
management anticipates fixed costs of $74,000 and variable costs equal to 37% of sales. what will income equal if sales are $340,000? multiple choice $125,800. $266,000. $140,200. $185,900. $51,800. The nurse is providing teaching regarding drug therapy to the husband of a woman with Alzheimer's disease. She was diagnosed 3 months ago, has mild memory loss, and will be receiving donepezil (Aricept). What is the drug's expected action? The risk premium is determined in the ____ (product markets, finacial markets, or factor markets) by the forces of supply and demand. Identify the null and alternative hypotheses for the following problems. (Enter != for as needed. )(a)The manager of a restaurant believes that it takes a customer less than or equal to 24 minutes to eat lunch. (Give your hypotheses in minutes. )H0:Ha:(b)Economists have stated that the marginal propensity to consume is at least 85 out of every dollar. H0:Ha:(c)It has been stated that 78 out of every 100 people who go to the movies on Saturday night buy popcorn. H0:Ha: the most common method for obtaining information covertly is the installation of a . Find a congressman senator who represents to write your letter to once you have made your choice 0.201 molmol of argon gas is admitted to an evacuated 80.3 cm3cm3 container at 10.3 c. the gas then undergoes an isothermal expansion to a volume of 313 cm3cm3 . Let E be the elliptic curve y^2 = x^3+2x +7 defined over Z31. It can be shown that #E = 39 and P = (2, 9) is an element of order 39 in E. The Simple Elliptic Curve-Based Cryptosystem defined on E has Z31* as a plaintext space. Suppose the private key is m = 8.(a.) Compute Q = mP.(b.) Decrypt the following string of ciphertext:((18, 1), 21), ((3, 1), 18), ((17, 0), 19) ((28, 0), 8).(c.) Assuming that each plaintext represents one alphabetic character, convert the plaintext into an English word. (Here we will use the correspondence A 1, . . . , Z26, because 0 is not allowed in a (plaintext) ordered pair.) Describe the preparation used. Be sure to include any changes made in the scheme presented in the discussion. ethyl butyrate-CH3(CH2)2COOCH2CH3 Earth takes in thermal energy from the Sun in a process called what Which of the following children is least likely to participate in an available neighborhood organization?a) Megan, who lives in a lower-middle class areab) Francois, who lives in a low-income areac) Chantel, who lives in a upper-middle class aread) Lucius, who lives in an affluent area Give only the rule section of a Lex input file for a scanner that prints only all the letters in its input on-screen, and ignores everything else. A 7.5 L vessel contains 20.0 g of NO2 (g) and 0.55 g of N2O4 (g) 2 NO2 (g) N2O4 (g) Calculate the value Qc knowing the equilibrium constant is 0.95 A. Qc < Kc so the reaction will shift to make more N2O4 B. Qc = Kc C. Qc < Kc so the reaction will shift to make more NO2 D. Qc > Kc so the reaction will shift to make more N2O4 E. Qc > Kc so the reaction will shift to make more NO2 Type the correct answer in each box. Use numerals instead of words. If necessary, use / for the fraction bar(s).What share of the 2 leftover flats of plants should I plant in each garden?Write the remainder as a fraction.a mathematical problem a project is represented by the activity durations (estimated at 90% likelihood of completion) and precedence requirements shown in the table. what is the overall duration of this project if it is managed using critical chain methodology? 1. A vendor claims that the hardness of metal test blocks has a mean of 62 Rockwell-C and standard deviation of 0.2. The product specifications are (62+0.8) and (62-0.8). A random sample is taken from the incoming blocks where the average and standard deviation for the sample data are respectively 61.8 and 0.3. I a. What is PCR according to vendor's claim ? b. What is PCR according to the incoming sample? C. Does the sample data indicate that vendor supplied honest information? which of the following best describes important considerations in treatment of american indian substance abusers? brooke has been experiencing a period of rapid pubertal change. brooke is in which phase of adolescence? use a power series to approximate the definite integral, i, to six decimal places. 0.2 1 1 x5 dx 0 Polyas urn model supposes that an urn initially contains r red and b blue balls. At each stage a ball is randomly selected from the urn and is then returned alongwith m other balls of the same color. Let Xk be the number of red balls drawn inthe first k selections. (a) Find E[X1]. (b) Find E[X2]. (c) Find E[X3]. (d) Conjecture the value of E[Xk], and then verify your conjecture by a conditioningargument