4) Create a text file (you can name it sales.txt) that contains in each line the daily sales of a company for a whole month. Then write a Java application that: asks the user for the name of the file, reads the total amount of sales, calculates the average daily sales and displays the total and average sales. (Note: Use an ArrayList to store the data).

Answers

Answer 1

Answer:

Here's an example Java application that reads daily sales data from a text file, calculates the total and average sales, and displays the results:

import java.util.ArrayList;

import java.util.Scanner;

import java.io.File;

import java.io.FileNotFoundException;

public class SalesDemo {

   public static void main(String[] args) {

       // Ask the user for the name of the file

       Scanner input = new Scanner(System.in);

       System.out.print("Enter the name of the sales file: ");

       String fileName = input.nextLine();

       // Read the daily sales data from the file

       ArrayList<Double> salesData = new ArrayList<>();

       try {

           Scanner fileInput = new Scanner(new File(fileName));

           while (fileInput.hasNextDouble()) {

               double dailySales = fileInput.nextDouble();

               salesData.add(dailySales);

           }

           fileInput.close();

       } catch (FileNotFoundException e) {

           System.out.println("Error: File not found!");

           System.exit(1);

       }

       // Calculate the total and average sales

       double totalSales = 0.0;

       for (double dailySales : salesData) {

           totalSales += dailySales;

       }

       double averageSales = totalSales / salesData.size();

       // Display the results

       System.out.printf("Total sales: $%.2f\n", totalSales);

       System.out.printf("Average daily sales: $%.2f\n", averageSales);

   }

}

Assuming that the sales data is stored in a text file named "sales.txt" in the format of one daily sale per line, you can run this program and input "sales.txt" as the file name when prompted. The program will then calculate the total and average sales and display the results.

I hope this helps!

Explanation:


Related Questions

Formal Writing Assignment: CUNY WAN Modernization Project Spring 2023
The CUNY University System has begun developing programs for enterprising professionals and advanced degree students that want to complete their studies remotely. This emerging need originated when the CUNY University System was operating fully remote due to the Corona virus. There is significant interest in continuing to provide this remote mode of instruction and expand it to new outreach programs within the New York City region. The CUNY University System has hired you to provide help with their modernized WAN that will be needed for developing these new programs.

Providing WAN Services to Remote locations
CUNY University System plans to offer night and weekend classes for professionals and advanced degree students, paralegal students, and nurses, in five “Centers of Excellence” remote locations at each borough of the City of New York.. Its plan is to have professors offer the classes from the main campus site and to use video conferencing and multimedia options at these “Centers of Excellence” remote sites. The CUNY University System main site has a TCP/IP Ethernet network. The remote “Centers of Excellence” sites, which are not yet set up, will also have TCP/IP Ethernet networks.
The CUNY University System Director of Information Technology is asking you to write a proposal for three WAN options (possible candidates are: Frame Relay, Broad Band and MPLS) to connect the “Centers of Excellence” remote sites to the main campus and provide a rationale for each of these options. Your WAN options must provide for the use of voice over IP, video conferencing and multimedia applications. Each WAN option should provide details on the following factors:
 How does the technology work?
 Bandwidth costs
 Bandwidth allocation (how much bandwidth is available/supported) by the method.
 Equipment costs associated with the method.
 Ability for the method to address future expanded bandwidth requirements.
 Ability for the method to incorporate other applications such as voice and video.
 Ability for the method to offers fault tolerant options to provide more guaranteed uptime—an important consideration for providing long-distance learning.
Teaching Classes from Home
The CUNY University System president enjoys participating in several classes once a week as a guest speaker or mentor, but she wants to do this from home, so she can spend more time with her family instead of driving back to the main CUNY University System campus, which is about ten miles away.
Write a 1–2-page letter to the CUNY University System president explaining how she might be connected to the main CUNY University System campus network through a particular WAN technology, and why you recommend that WAN technology. One of the requirements is that she needs to be able to use the telephone in her home office while she is connected to the CUNY network.
WAN Connectivity for a Business Incubator
The CUNY University System is starting a business incubator on the main campus. The business incubator provides one year of resources for up to five new small businesses, including a business location and office resources, such as computers, printers, scanners and Internet access. Write a 1–2-page letter to the CUNY University System president explaining to her the WAN connectivity options that are most appropriate for these small businesses, so that it is consistent with what they can use when they leave the incubator facilities.

Answers

In order to carry out this assignment, you want to make sure that you research and thouroughly understand the Wide Area Network (WAN) techologies of Frame Relay, Broad Bank, and MPLS.

What else needs to be done?

You must present a proposal for each WAN alternative, describing the bandwidth prices, allocation, equipment costs, capacity to handle future bandwidth requirements, include audio and video, and offer fault-tolerant choices.

You would need to submit a letter outlining the proposed WAN technology to link her to the campus network while enabling her to use her phone in response to the CUNY University System president's request to participate in classes from home.

You would also need to produce another letter for the business incubator describing the best WAN connectivity alternatives for small enterprises to use once they depart the incubator facility. Thus,, the project necessitates good research abilities as well as the ability to communicate material clearly and concisely.

Learn more about WAN:
https://brainly.com/question/621746
#SPJ1

Nigeria Amateur Volleyball Association was formed in what year​

Answers

Answer:

The Nigerian Amateur Volleyball Association was formed in 1969.

PLS MARK BRAINLIEST

Explanation:

Answer:

1969

Explanation:

The Nigerian Amateur Volleyball Association was formed in 1969.

3. In your own opinion, with all the policies and procedures being made or created and perfected, why is it that these rules are still being violated or abused

Answers

With all the policies and procedures being made or created and perfected, the reason these rules are said to be still being violated or abused are:

Lack of AwarenessHuman Error

What are the policies?

Lack of Awareness  is one that shows that even if there are policies as well as procedures that are said to be made and perfected, people or employees can not be fully made known of them and as a result can bring about  unintentional form of  violations or abuse.

Lastly in terms of Human Error, one need to know that people's Mistakes or lapses can be seen in terms of judgment  and this can lead to abuse also.

Learn more about policies from

https://brainly.com/question/3006046

#SPJ1

if-else AND if-elif-else
need at minimum two sets of if, one must contain elif
comparison operators
>, <, >=, <=, !=, ==
used at least three times
logical operator
and, or, not
used at least once
while loop AND for loop
both a while loop and a for loop must be used
while loop
based on user input
be sure to include / update your loop control variable
must include a count variable that counts how many times the while loop runs
for loop must include one version of the range function
range(x), range(x,y), or range(x,y,z)
comments
# this line describes the following code
comments are essential, make sure they are useful and informative (I do read them)
at least 40 lines of code
this includes appropriate whitespace and comments
python

Answers

Based on the image, one can see an example of Python code that is said to be able to meets the requirements that are given in the question:

What is the python?

The code given is seen as a form of  a Python script that tells more on the use of if-else as well as if-elif-else statements, also the use of comparison operators, logical operators, and others

Therefore, one need to know that the code is just a form of an example and it can or cannot not have a special functional purpose. It is one that is meant to tell more on the use of if-else, if-elif-else statements, etc.

Learn more about python from

https://brainly.com/question/26497128

#SPJ1

three ways in which technology can be used to assist the teacher in education and learning process

Answers

Electronic grade books
digital portfolios
learning games

Select the correct answer from each drop-down menu.
Lucy wants to add some notes in her research paper that provide additional information to the reader. She also wants to display her university logo on all the pages as part of the title. What formatting can she apply to her document to include these details?
Lucy can display her notes in the form of a . She can indicate the logo as part of the .

Answers

Lucy can display her notes in the form of a footnote or endnote

She can indicate the logo as part of the header or footer section.

What is a Footnote?

This refers to the bottom of a page is where footnotes are located. They provide references or offer commentary on a specific passage of material above it. Say, for instance, that you want to add a thought to a sentence you have written, but the thought has nothing to do with the thesis of your paragraph.

Hence, it can be seen that for Lucy to accurately add her notes, she has to add them as a footnote or end note and would be placed in the header or footer section for her logo.

Read more about logo here:

https://brainly.com/question/22856492

#SPJ1

You may review Chapter 2, pages 67-71 of the textbook or communication skills.
Now please answer the following questions:
• What communication systems do you believe are best to be used at a help desk?
• What may be a couple of reasons for the satisfaction disparity?
• How can you ensure that all employees are satisfied with the help desk's services regardless of how
Responses to Other Students: Respond to at least 2 of your fellow classmates with at least a 50-100-w
found to be compelling and enlightening. To help you with your discussion, please consider the following
• What differences or similarities do you see between your posting and other classmates' postings?
**what communication system do you believe are best to be used at a help desk?

Answers

The communication systems that are said to be used at help desks are:

Phone as well as Call Center SystemThe use of Email SystemThe use of Ticketing System

What is the communication systems?

In terms of Phone as well as Call Center System: This is seen as a form of a traditional system of communication  that is often used as help desks.

It is one that gives room for a lot of users to be able ot call as well as speak directly with the person who is a help desk agents for any form of assistance.

Hence the choice of communication  the the person who is help desk wants to use can depend on a lot of factors.

Learn more about   communication systems from

https://brainly.com/question/30023643

#SPJ1

verom each drop-down menu. Raymond is assigned the task of backing up the data on a web server. However, he has limited storage place on the backup media.. Which type of backup should he choose and how would it benefit him?


Raymond should select a(n)_______backup.

The benefit of using this type of backup is that there is______.​

Answers

Raymond should select a(n) incremental backup.

The benefit of using this type of backup is that there is a lower storage space requirement compared to a full backup. Incremental backups only copy the data that has been changed since the last backup, which means that they require less storage space than a full backup that copies all the data every time. This allows Raymond to back up the web server's data more frequently and efficiently, with less strain on the storage media.

State three modules in HansaWorld and briefly describe what each is used for. (6)
2. With an example, explain what settings are used for. (3)
3. What is Personal Desktop and why is it good to use? Mention two ways in which an
entry can be deleted from the personal desktop. (6)
4. Describe how you invalidate a record in HansaWorld (3)
5. Briefly explain what specification, paste special and report windows are used for. (6)
6. How many reports can you have on the screen at once? How many reports does
HansaWorld have? (4)
7. Describe any two views of the Calendar and how you can open them (4)
8. Describe three (3) ways in which records can be attached to Mails. (6)
9. Describe the basic SALES PROCESS where there is no stock involved and how the
same is implemented in HansaWorld. (12)

Answers

1. We can see here that the three modules in HansaWorld and their brief descriptions:

AccountingInventoryCRM

2. We can deduce that settings are actually used in HansaWorld for used for configuring the system to meet specific business requirements.

What is HansaWorld?

It is important for us to understand what HansaWorld is all about. We can see here that HansaWorld is actually known to be an enterprise resource planning (ERP) system that provides integrated software solutions for businesses.

3. Personal Desktop is actually known to be a feature in HansaWorld. It allows users to create a personalized workspace within the system.

It can help users to increase their productivity and efficiency.

4. To actually invalidate a record in HansaWorld, there steps to take.

5. We can deduce here that specification, paste special and report windows help users to actually manage data and generate report.

6. There are factors that play in in determining the amount of reports generated.

7. The Calendar on HansaWorld is used to view upcoming events. There is the Day View and there is the Month View.

8. We can see that in attaching records, HansaWorld allows you to:

Drag and drop.Insert linkUse the Mail Merge Function

Learn more about report on https://brainly.com/question/26177190

#SPJ1

You may review Chapter 2, pages 67-71 of the textbook or communication skills.
Now please answer the following questions:
• What communication systems do you believe are best to be used at a help desk?
• What may be a couple of reasons for the satisfaction disparity?
• How can you ensure that all employees are satisfied with the help desk's services regardless of how
Responses to Other Students: Respond to at least 2 of your fellow classmates with at least a 50-100-w
found to be compelling and enlightening. To help you with your discussion, please consider the following
• What differences or similarities do you see between your posting and other classmates' postings?
**
M
hp

Answers

Customer satisfaction is very important. A good insights as well as guidance in regards to the question are given below

What is the review?

In terms of Communication systems that is made for a help desk: The right one to use in terms of communication systems for a help desk would is one that is based on the key needs as well as the need requirements of the firm and that of their customers.

Therefore, Reasons for satisfaction in terms of disparity are:

Inconsistent in terms of service qualityLack of available resourcesTraining as well as development

Learn more about review from

https://brainly.com/question/25955478

#SPJ1

Discuss telephone scheduling and identify critical information required for scheduling appointments for new patients. Demonstrate how to expedite a new patient call by following a prescribed set of questions. Please list all the questions needed for the appointment.

Answers

Telephone scheduling is an important process for medical practices, as it determines how efficiently appointments are booked and how well patients are served. When scheduling appointments for new patients, it is important to gather critical information that will help ensure that the patient is seen by the appropriate healthcare provider and that the appointment is scheduled at a time that is convenient for both the patient and the practice.

Some critical information required for scheduling appointments for new patients includes:

1. Patient's name and contact information
2. Reason for the visit or chief complaint
3. Referring physician, if applicable
4. Insurance information, including policy number and group number
5. Preferred healthcare provider, if known
6. Availability for appointment scheduling, including days and times that work best for the patient

To expedite a new patient call, it is important to follow a prescribed set of questions that will ensure that all of the necessary information is gathered efficiently. Here is a list of questions that may be used to schedule a new patient appointment:

1. May I have your name, please?
2. What is the reason for your visit or chief complaint?
3. Do you have a referring physician? If so, what is their name?
4. Do you have insurance? If so, may I have your policy number and group number?
5. Do you have a preferred healthcare provider? If so, who would you like to see?
6. What days and times work best for you for an appointment?

By asking these questions in a systematic and organized way, medical practices can ensure that new patient calls are handled efficiently and effectively, resulting in better patient satisfaction and improved outcomes.

The appointment scheduler can ensure that all the necessary information is collected and the appointment is successfully scheduled.

Telephone scheduling is the process of reserving an appointment for new patients over the phone. An important component of telephone scheduling is making sure all of the critical information required for a successful scheduled appointment is collected.

Questions that are typically used to expedite a new patient call include:

• What is the patient's name, address, date of birth, and phone number?

• Is the patient covered by an insurance plan?

• What type of appointment is being scheduled?

• Who is the preferred provider and location?

• What is the estimated length of the appointment?

• Is any advanced paperwork needed or special instructions?

• What is the patient's preferred day and time for the appointment?

• Will the patient need any special accommodations?

• Is the patient a new or returning patient?

• How did the patient hear about the practice or provider?

Hence, the appointment scheduler can ensure that all the necessary information is collected and the appointment is successfully scheduled.

Learn more about the telephone scheduling here:

https://brainly.com/question/33364877.

#SPJ6

You may review Chapter 2, pages 67-71 of the textbook or communication skills.
Now please answer the following questions:
• What communication systems do you believe are best to be used at a help desk?
• What may be a couple of reasons for the satisfaction disparity?
• How can you ensure that all employees are satisfied with the help desk's services regardless of how
Responses to Other Students: Respond to at least 2 of your fellow classmates with at least a 50-100-w
found to be compelling and enlightening. To help you with your discussion, please consider the following
• What differences or similarities do you see between your posting and other classmates' postings?
**
What communication system do you believe are best to be used at a help desk ?

Answers

Note that the above prompt ahs to do with communication skills and communication systems.

What is the best communication system for a help desk?

Note that the best communication set up or system for a help desk is one that allows they to quickly address customer inquires.

How can this be implemented? this can be done via esuring that the help desk has a variety of communication channels such as:

EmailsPhoneLive ch. at; and Social media.

Communication systems are best most effective when they are manned by trained support agents who are also able to carry out ticketing of issues effectivley and eficiently.

Note that one fo the metrics for measuring the effectiveness of communication systems is time taken to resolve issues.

Learn more about communication systems at:

https://brainly.com/question/18825060

#SPJ1

What formatting changes do spreadsheet applications permit in the rows and columns of a spreadsheet?
Row and Column Formatting Options
Formatting rows and columns is similar to cell formatting. In an OpenOffice Calc spreadsheet, you can format data entered into rows and columns with the help of the Rows and Columns options. You can insert rows and columns into, or delete rows and columns from, a spreadsheet. Use the Insert or Delete rows and columns option on the Insert tab. Alternatively, select the row or column where you want new rows or columns to appear, right-click, and select Insert Only Row or Only Column options.

You can hide or show rows and columns in a spreadsheet. Use the Hide or Show option on the Format tab. For example, to hide a row, first select the row, then choose the Insert tab, then select the Row option, and then select Hide. Alternatively, you can select the row or columns, right-click, and select the Hide or Show option.

You can adjust the height of rows and width of columns. Select Row and then select the Height option on the Format tab. Similarly, select Column, then select the Width option on the Format tab. Alternatively, you can hold the mouse on the row and column divider, and drag the double arrow to the position. You can also use the AutoFit option on the Table tab to resize rows and columns.

Answers

Formatting rows and columns in a spreadsheet is similar to cell formatting. In OpenOffice Calc, users can insert or delete rows and columns, hide or show them, and adjust the height and width of the rows and columns.

What is spreadsheet?

A spreadsheet is an electronic document that stores data in a tabular format and is used to perform calculations and analysis. It is a type of software program designed to assist with data entry, calculations, and other analysis tasks. Spreadsheets often contain formulas and functions that allow users to quickly and accurately calculate values based on the data they enter. Spreadsheets also provide users with the ability to present data in an organized and visually appealing way. Spreadsheets are an essential tool for businesses, schools, and other organizations to help them make decisions, track progress, and manage resources.

Users can access these options from the Insert, Format, and Table tabs. Alternatively, they can select the row or column they want to format, right-click, and select the relevant option. Additionally, users can hold the mouse on the row or column divider and drag the double arrow to the desired position. The AutoFit option on the Table tab can also be used to resize rows and columns.

To learn more about spreadsheet
https://brainly.com/question/30039670
#SPJ1

Drag each tile to the correct box.
Match each job title to its description.

Answers

Answer:

You're going to need to send a better picture, it's too blurry.

Fill in the blank after egrep to get output on matrix exactly as shown

$ egrep "_____________" ~mark.fernandes/pub/notes/data/cars

plym fury 77 73 2500
chevy nova 79 60 3000
volvo gl 78 102 9850
Chevy nova 80 50 3500
fiat 600 65 115 450
honda accord 81 30 6000
toyota tercel 82 180 750
chevy impala 65 85 1550


NO quotes. Use as few characters as you can to get the output above.
Answer does not use egrep options. Keep trying as many answers exist.

HINT: Use answer(s) from previous question(s) for clues to solve this
question except these blanks use regex not egrep options and no quotes.

Answers

One possible answer to the above output is:

ruby

(?i)chevy nova.*$

What is the output  about?

(?i) - This is a flag for case-insensitive matching, which allows "Chevy" to match both "Chevy" and "chevy".

chevy nova - This is the literal string "chevy nova".

.*$ - This matches any characters (.*) until the end of the line ($), effectively capturing the entire line that contains "chevy nova".

The regex pattern that fills the blank is:

css

^.{4}\b

The output of the command will be:

yaml

plym fury 77 73 2500

chevy nova 79 60 3000

volvo gl 78 102 9850

Chevy nova 80 50 3500

fiat 600 65 115 450

honda accord 81 30 6000

toyota tercel 82 180 750

Therefore, The ^ character matches the beginning of the line. The .{4} pattern matches any character (except for a newline) exactly 4 times. This matches the first four characters of each line in the input.

Read more about output  here:

https://brainly.com/question/14352771

#SPJ1

How much paint?

A gallon of paint covers 422 square feet and costs $29.85. Using flowgorithm
determine and display the amount of paint it will take to paint a fence of a
specified height and length, the fence is solid not rails. Your flowgorithm should perform the following tasks:

 Declare all required variables
 Declare constants and initialize them
 Prompt for the input of the fence height
 Prompt for the input of the fence length
 Calculate the total square feet to be painted
 Calculate the required number of gallons of paint required, you cannot
purchase a partial gallon of paint**
 Display, with appropriate output labels, the total square feet to be painted,
the number of gallons of paint needed and the total cost of the paint
 Ask if a second estimate needs to be made (keep program running until told
to stop)
**modulo operator perhaps

Remember the following:

 make sure your calculations are correct
 use clear prompts for your input
 label each output number or name

Answers

Flowgorithm is a graphical create tool that allows users to rewrite and execute programs utilizing flowcharts.

What is the agorithm?

The approach is designed to stress the algorithm rather than the arrangement of a specific register language. The flowchart maybe converted to various major the study of computers.

The ceiling function is used friendly 3.4 to round up the number of gallons of paint necessary to the nearest number, since you cannot purchase a partial unit of capacity for liquids of paint.This step ends the program after the consumer has finished making all the estimates they want to create.

Learn more about algorithm  from

https://brainly.com/question/24953880

#SPJ1

Consider that you have a code of 200,000 instructions which is executed using a 16 stages pipeline. It is expected that 20% of the instructions will cause an exception. In order to handle the exception, there is an exception handler which is using 20 cycles to execute (includes the flushing and reloading and the actual handling of the exception). The pipeline frequency is 2 GHz

i) How many cycles does it take to execute the code?

ii) What is the average CPI for this code?

iii) How long does it take to execute the code?

Answers

Answer:

i) The total number of cycles required to execute the code can be calculated as follows:

Total number of instructions = 200,000

Number of instructions causing exceptions = 20% of 200,000 = 40,000

Number of instructions without exceptions = 200,000 - 40,000 = 160,000

Cycles required for instructions without exceptions = 160,000 x 16 = 2,560,000

Cycles required for instructions causing exceptions = 40,000 x (16 + 20) = 1,440,000

Total number of cycles required = 2,560,000 + 1,440,000 = 4,000,000 cycles

ii) The average CPI (Cycles Per Instruction) can be calculated as follows:

Total number of cycles required = 4,000,000 cycles

Total number of instructions executed = 200,000 instructions

Average CPI = Total number of cycles required / Total number of instructions executed

= 4,000,000 / 200,000

= 20 cycles per instruction

iii) The time required to execute the code can be calculated as follows:

Total number of cycles required = 4,000,000 cycles

Pipeline frequency = 2 GHz

Time required to execute the code = Total number of cycles required / Pipeline frequency

= 4,000,000 / 2,000,000,000

= 2 milliseconds

To execute the code using a 16-stage pipeline, each instruction will take 16 cycles. Therefore, the total number of cycles required to execute 200,000 instructions is: 3,200,000 cycles.

What is CPI?

CPI stands for Cycles Per Instruction. It is a metric used to measure the efficiency of a computer's instruction processing. The lower the CPI, the more efficiently the computer is processing instructions.

Each instruction will take 16 cycles to execute using a 16-stage pipeline. As a result, the total number of cycles required to execute 200,000 instructions is as follows:

200,000 times 16 = 3,200,000 cycles

The percentage of instructions causing an exception is 20%, so the average CPI can be calculated as:

Average CPI = (Ideal CPI x Percentage of Instructions without Exceptions) + (Cycles per Exception x Percentage of Instructions with Exceptions)

Average CPI = (1 x 0.8) + (20 x 0.2)

Average CPI = 4.4 cycles per instruction

The length of time it takes to execute the code can be calculated using the following formula:

Execution Time = (Number of Cycles x Cycle Time)

Since the pipeline frequency is 2 GHz, the cycle time is:

Cycle Time = 1 / 2 GHz = 0.5 ns

Therefore, the execution time is:

Execution Time = (3,200,000 + (0.2 x 200,000 x 20)) x 0.5 ns

Execution Time = 1,640,000 ns

Thus, it takes 1,640,000 nanoseconds to execute the code.

For more details regarding CPI, visit:

https://brainly.com/question/14453270

#SPJ2

Modify the single-cycle MIPS processor to implement the following instruction: sll (shift left logical). Indicate changes to the datapath. Name any new control signals. Mark up the table below to show changes to the main decoder. Describe any other changes that are required.
Tip: sll is R type instruction, its op code is 000000; there is a shift amount field in the 32 bit instruction, bit 10:6; ALU table will need to add one more bit, so it will have 4 bits; ALU schematic will need to be modified.

Answers

MIPS (Microprocessor without Interlocked Pipeline Stages) is a family of RISC (Reduced Instruction Set Computing) processors. The answer is attached.

What is the processor about

It was developed in the early 1980s by researchers at Stanford University, and later became a commercial product through the company MIPS Technologies, which was later acquired by Imagination Technologies.

The MIPS architecture is designed to be highly efficient, with a small set of simple instructions that can be executed quickly. The design focuses on minimizing the number of clock cycles required to execute instructions, which makes it well-suited for applications where performance is critical, such as embedded systems, networking equipment, and graphics processing.

MIPS processors are still in use today, although they have been largely eclipsed by other architectures like ARM and x86 in the consumer electronics market. However, they remain popular in embedded systems and other specialized applications where low power consumption and high performance are important considerations.

Learn more about processor on

https://brainly.com/question/29629549

#SPJ1

Write a program that displays the number array below as an output. Use only do while
loop. N is a number entered by an user.

13 19 25 31 37 43 49 … N

Answers

Here's the Python code to solve the problem using a do-while loop:

n = int(input("Enter a number: "))

num = 13

print(num, end=" ")

while True:

num += 6

if num > n:

break

print(num, end=" ")

1. What would be the best explanation of the variable name 'int indexSize'?
a. Shows the number in the index is big
b. Holds the number in the last index spot
c. Holds the number in the first index spot
d. Holds the number of indexes in the array

Answers

1The option that would be the best explanation of the variable name 'int indexSize' is option d. Holds the number of indexes in the array

What is the variable about?

The variable name 'int indexSize' is one that tells that it have the number of indexes in an array.

Note that The use of the term "indexSize" is one that tells that it stand for the size or the amount of the indexes in the array, and thus it is one that is telling the total number of indexes as well as the elements that is seen in the array.

Therefore, It is common work in programming to be able to make use of variable names that are said to be descriptive.

Learn more about variable from

https://brainly.com/question/28248724

#SPJ1

pretend it is 2012, describe two companies that still exist
and tell me why you think they did well in the last 10 years. These should be stocks that are publicly traded. You can purchase stocks on NASDAQ and the New York Stock Exchange.

Answers

Answer:

One company that still exists and has done well in the last 10 years is Apple Inc. (AAPL). Apple is a publicly-traded company that produces consumer electronics, computer software, and online services. In the last 10 years, Apple has continued to innovate and release new products, such as the iPhone, iPad, and Apple Watch. These products have been very successful, and have helped Apple become one of the most valuable companies in the world. Additionally, Apple has a loyal customer base and a strong brand, which has helped it maintain its position in the market.

Another company that still exists and has done well in the last 10 years is Amazon.com, Inc. (AMZN). Amazon is a publicly-traded company that operates an online marketplace and provides cloud computing services. In the last 10 years, Amazon has continued to grow and expand, both in terms of its product offerings and its geographic reach. Amazon has also invested heavily in new technology, such as artificial intelligence and robotics, which has helped it stay ahead of the competition. Additionally, Amazon has a strong focus on customer service and satisfaction, which has helped it build a loyal customer base and maintain its position as a leader in the e-commerce industry.

Ginny realized that Delphi had returned to Godric's Hollow so she could

Answers

What did Ginny realize Delphi wanted to do?

What does Ginny realize once they get to the past? Delphi chose this very moment, not to kill baby Harry, but rather to forestall Voldemort and prevent him from attacking the Potters in the first place. This would ensure Voldemort's reign of terror would continue

What is the running time to perform the following operations: (a) minimum (b) maximum (c) median (d) average (e) search/look-up (f) predecessor (g) successor, for a dynamic set with n keys implemented using the following data structures: (a) binary search tree (b) hash table based dictionary (c) direct address based dictionary (d) red-back tree (e) van-emde boas tree.

Answers

The running time that is used for a lot of operations in a lot of data structures for any given dynamic set with n keys are known to be given below.

What is the running time  about?

In terms of  (a) Minimum time they are:

Binary search tree: This is seen as O(h), and it is one where h is seen as the height of the said tree.

In terms of Hash table based dictionary: It is one that is not applicable, as it is one where the hash tables do not aid or support any form of finding of any kind in terms of the minimum element.

Lastly in terms of Direct address based dictionary: O(1) is one that is seen as as the minimum element that is it is one that can be directly accessed via the use of its key. Red-black tree: is one where the O(1), is one that act as red-black trees that tends to keep a subtree via the use of the minimum element found at its root.

Learn more about running time  from

https://brainly.com/question/26046491

#SPJ1

Can someone help me fix my code for this question? got pretty far but now i'm stuck on the syntax error.

In this lab, you use what you have learned about parallel arrays to complete a partially completed C++ program. The program should:
Either print the name and price for a coffee add-in from the Jumpin’ Jive Coffee Shop
Or it should print the message Sorry, we do not carry that.
Read the problem description carefully before you begin. The file provided for this lab includes the necessary variable declarations and input statements. You need to write the part of the program that searches for the name of the coffee add-in(s) and either prints the name and price of the add-in or prints the error message if the add-in is not found. Comments in the code tell you where to write your statements.

Instructions
Study the prewritten code to make sure you understand it.
Write the code that searches the array for the name of the add-in ordered by the customer.
Write the code that prints the name and price of the add-in or the error message, and then write the code that prints the cost of the total order.
Execute the program by clicking the Run button at the bottom of the screen. Use the following data:

Cream

Caramel

Whiskey

chocolate

Chocolate

Cinnamon

Vanilla

The Gdb one is what i have so far but i can't figure out what i'm doing wrong as far as syntax.

Answers

To be able to complete the code that can be used to searching a coffee add-in in an array as well as printing its name and price, look at the example of the implementation in C++ that is given below

What is the syntax error?

In the code that is known to be given, one can declare as well as initialize two arrays - addIns that can be used for saving the names of coffee add-ins, as well as the prices for saving of  the prices of the all of the corresponding add-ins.

Therefore, We can be able to collect input from a given customer for the coffee add-in they need to order. Finally, we can be able to make use of an if-else statement to be able to print the name and price of all ofthe add-i.

Learn more about syntax error from

https://brainly.com/question/28957248

#SPJ1

Create a dice game that randomly “rolls” five dice for the computer and five dice for the player. After each random roll, store the result in a computer dice roll list and player dice roll list. The application displays all the values, which can be from 1 to 6 inclusive for each die. Decide the winner based on which player had the largest number of matching dice. For this game, the numeric dice values do not count. For example, if both the player and computer have three of a kind, it is a tie, no matter what the values of the three dice are.


Be sure to review the provided links on generating random integers, and using the Python count() function, as both will be used in this program. To assist you, pseudocode has been provided. Download the file DiceGamePseudocode.py and follow the pseudocode to complete the program.


Program 2 requirements:


The program generates and stores five random dice values each for the player and computer

The program determines the largest number of matching dice for the player and computer

The program displays the dice values for the player and computer

The program displays the largest number of matching dice for the player and computer

The program uses a decision structure to display a message indicating who won the game


And please follow the pseudocode!

Answers

The Python program that can be able to implements the dice game based on the things that are given in the pseudocode is given below.

What is the dice game about?

This python code is known to be program that tends to bring about or make as well as stores five random dice values for the people that is both the player as well as  computer using list comprehensions.

Therefore, it is one that tends to make use the max() function along with the key parameter that is known to be set to the count() method to be able to find the most frequent dice value for all of the player as well as the computer.

Hence The program also shows  the dice values as well as the number of matching dice for all of the player.

Learn more about dice game from

https://brainly.com/question/30028788

#SPJ1

One concern about Internet advertising is that viral marketing________.
a.
Can create an air of excitement
b.
Can be entertaining to consumers
c.
Can mislead or exploit consumers
d.
None of the above


Please select the best answer from the choices provided

A
B
C
D

Answers

One concern about Internet advertising is that viral marketing c. Can mislead or exploit consumers

What is the Internet advertising?

Viral advertising is a form of blasting that aims to spread facts or knowledge about a product or duty through public networks and spoken.

While it maybe active in constructing excitement and amusement for shoppers, skilled are still concerns that it maybe deceptive or exploitative if it is not understandable or candid in allure to foreshadow. For example, fervid shopping campaigns may use dishonest strategies to a degree fake information or fake consumer reviews to advance a product or duty, etc.

Learn more about advertising  from

https://brainly.com/question/1658517

#SPJ1

Other Questions
What parasite is sometimes seen on the surface of the eye, especially on the West coast? How is it treated? Take Notes Literacy Skills: Sequence Use what you have read to complete the timeline with the FIVE important battles that occurred during 1862. Then, in the box at the bottom, write the significance of each battle. February: Capture of Forts Henry and Donelson What act by Germany marked the beginning of WW2? 8. Evaluate the extent to which trans-Evaluate the relative importance of causes of population movement to colonial British America in the period from 1607 to 1754 The driver's left hand and arm are extended upward. This hand signal means that the driver plans to:a. Turn left.b. Turn right.c. Stop. The _____________ describes the company's approach to determining a cost structure that will allow for acceptable profits, given the pricing tied to its customer value proposition. Which best expresses the value for the coeffecient of volume expansion, , for given material as a function of its corresponding coefficient of linear expansion, ? Which measurement is closest to the volume of the sphere in cubic inches What is "edge to area ratio" and how is it related to deforestation and fragmentation?What is the relationship between patch size and edge to area ratio?Why is the edge to area ratio ecologically important? Suppose X - N(2, 0.7). a. What value of x has a z-score of 4? b. What value of x has a z-score of -4? What provides the rotational force to arm the M905 fuze? What will happen if you touch the ball of a charged electroscope with your finger? Headaches- the 3 types of headaches share a single avenue/origin... What is it? which statement is correct regarding an aircraft that is found to be unairworthy after an annual inspection, due to an item requiring a major repair (assuming approved data is used to accomplish the repair)? which example describes a strong work ethic? working overtime for free using sick days when you are tired meeting all deadlines not taking any vacation days Find the particular solution determined by the initial condition. f'(x) = 6x2/3 - 5x3; f(1) = - 9 f f(x)= an unknown solution was determined to be basic. when this solution was combined with lemon juice (a known acid) no visible change occurred. this means that the unknown could be Factor the binomial 10x^3 - 20x Find - S4 (4x + 3y)dA where R is the parallelogram with vertices (0,0), (1,4), (3,-1), and (4,3). Use the transformation = u +30, y = 4u - v Question Help: Video Submit Question Jump to Answer Questio True or False:Artifacts are likely to appear when the dimensions of the sound beam area are larger than the dimensions of the reflectors in the body.