Write a program that lets a maker of chips and salsa keep track of sales for five different types of salsa: mild, medium, sweet, hot, and zesty. The program should use two parallel 5-element arrays: an array of strings that holds the five salsa names and an array of integers that holds the number of jars sold during the past month for each salsa type. The salsa names should be stored using an initialization list at the time the name array is created. The program should prompt the user to enter the number of jars sold for each type. Once this sales data has been entered, the program should produce a report that displays sales for each salsa type, total sales, and the names of the highest selling and lowest selling products.

Answers

Answer 1

Answer:

The program in Java is as follows:

import java.util.*;

public class Main{

public static void main(String[] args) {

 Scanner input = new Scanner(System.in);

 String [] salsa = {"Mild","Medium","Sweet","Hot","Zesty"};

 int [] number = new int[5];

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

     System.out.print(salsa[i]+" number: ");

     number[i] = input.nextInt();

 }

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

     System.out.println(salsa[i]+" : "+number[i]);

 }

 int smallest = number[0];  int highest = number[0];

 int count = 0;

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

     if(smallest > number[i]){

         smallest = number[i];

         count = i;

     }

 }

 System.out.println("Smallest");

 System.out.println(salsa[count]+" : "+smallest);

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

     if(highest < number[i]){

         highest = number[i];

         count = i;

     }

 }

 System.out.println("Highest");

 System.out.println(salsa[count]+" : "+highest);

}

}

Explanation:

This initializes the salsa names

 String [] salsa = {"Mild","Medium","Sweet","Hot","Zesty"};

This declares the array for the amount of salsa

 int [] number = new int[5];

This iterates through the 5 salsas and get input for the amount of each

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

     System.out.print(salsa[i]+" number: ");

     number[i] = input.nextInt();

 }

This prints each salsa and the amount sold

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

     System.out.println(salsa[i]+" : "+number[i]);

 }

This initializes smallest and largest to the first array element

 int smallest = number[0];  int highest = number[0];

This initializes the index of the highest or lowest to 0

 int count = 0;

The following iteration gets the smallest of the array elements

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

     if(smallest > number[i]){

         smallest = number[i];

This gets the index of the smallest

         count = i;

     }

 }

This prints the smallest

 System.out.println("Smallest");

 System.out.println(salsa[count]+" : "+smallest);

The following iteration gets the largest of the array elements    

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

     if(highest < number[i]){

         highest = number[i];

This gets the index of the highest

         count = i;

     }

 }

This prints the highest

 System.out.println("Highest");

 System.out.println(salsa[count]+" : "+highest);


Related Questions

Which tab should you click if you want to access the Show All Comments option in a worksheet?

Home
Page Layout
Review
View

Answers

Answer: Review

Because you want to review the comments

Answer:

C.) Reivew

Explanation:

Doing it on EDG now!

Best luck to yall :3

Have a good day and byee

Which work habits should you follow to increase work efficiency and avoid health issues?

Answers

Answer:

Just get good sleep, eat breakfast, and exercise.

Answer:

take periodic breaks and alternate between tasks

Code.org lesson 8 level 5

Answers

Answer:

and?

Explanation:

What is the hamming distance between the following bits? Sent
bits: 101100111, Received bits: 100111001
Select one: 5. Or 3 or 6 or4​

Answers

I think

the hamming distance between the following bits its 5

Which of the following best explains how an analog audio signal is typically represented by a computer?
a. An analog audio signal is measured at regular intervals. Each measurement is stored as a sample, which is represented at the lowest level as a sequence of bits.
b. An analog audio signal is measured as a sequence of operations that describe how the sound can be reproduced. The operations are represented at the lowest level as programming instructions.
c. An analog audio signal is measured as input parameters to a program or procedure. The inputs are represented at the lowest level as a collection of variables.
d. An analog audio signal is measured as text that describes the attributes of the sound. The text is represented at the lowest level as a string.

Answers

Answer:

A. An analog audio signal is measured at regular intervals. Each measurement is stored as a sample, which is represented at the lowest level as a sequence of bits.

Explanation:

I took the test

3.4 code practice question 2 edhesive

Answers

???????????????????
Is there more to this question??

answer any one: write a computer program:​

Answers

Answer:

hope this helps you look it once.

What is the main fuction of command interpreter​

Answers

The command interpreter or the command-line interface is one of the ways a user can interface with the operating system. The command interpreter's main task is to understands and executes commands which it turns into system calls. The kernel is the central module of an OS.

_________________

Brainliest would be greatly appreciated!

I found this!

_________________

#SpreadTheLove

#SaveTheTrees

- Mitsu JK

Write a MIPS assembly language program that prompts for a user to enter a series of floating point numbers and calls read_float to read in numbers and store them in an array only if the same number is not stored in the array yet. Then the program should display the array content on the console window.
Consult the green sheet and the chapter 3 for assembly instructions for floating point numbers. Here is one instruction that you might use:
c.eq.s $f2, $f4
bc1t Label1
Here if the value in the register $f2 is equals to the value in $f4, it jumps to the Label1. If it should jump when the value in the register $f2 is NOT equals to the value in $f4, then it should be:
c.eq.s $f2, $f4
bc1f Label1
To load a single precision floating point number (instead of lw for an integer), you might use:
l.s $f12, 0($t0)
To store a single precision floating point number (instead of sw for an integer), you might use:
s.s $f12, 0($t0)
To assign a constant floating point number (instead of li for an integer), you might use:
li.s $f12, 123.45
To copy a floating point number from one register to another (instead of move for an integer), you might use:
mov.s $f10, $f12
The following shows the syscall numbers needed for this assignment.
System Call System Call System Call
Number Operation Description
2 print_float $v0 = 2, $f12 = float number to be printed
4 print_string $v0 = 4, $a0 = address of beginning of ASCIIZ string
6 read_float $v0 = 6; user types a float number at keyboard; value is store in $f0
8 read_string $v0 = 8; user types string at keybd; addr of beginning of string is store in $a0; len in $a1
------------------------------------------
C program will ask a user to enter numbers and store them in an array
only if the same number is not in the array yet.
Then it prints out the result array content.
You need to write MIPS assembly code based on the following C code.
-------------------------------------------
void main( )
{
int arraysize = 10;
float array[arraysize];
int i, j, alreadyStored;
float num;
i = 0;
while (i < arraysize)
{
printf("Enter a number:\n");
//read an integer from a user input and store it in num1
scanf("%f", &num);
//check if the number is already stored in the array
alreadyStored = 0;
for (j = 0; j < i; j++)
{
if (array[j] == num)
{
alreadyStored = 1;
}
}
//Only if the same number is not in the array yet
if (alreadyStored == 0)
{
array[i] = num;
i++;
}
}
printf("The array contains the following:\n");
i = 0;
while (i < arraysize)
{
printf("%f\n", array[i]);
i++;
}
return;
}
Here are sample outputs (user input is in bold): -- note that you might get some rounding errors
Enter a number:
3
Enter a number:
54.4
Enter a number:
2
Enter a number:
5
Enter a number:
2
Enter a number:
-4
Enter a number:
5
Enter a number:
76
Enter a number:
-23
Enter a number:
43.53
Enter a number:
-43.53
Enter a number:
43.53
Enter a number:
65.43
The array contains the following:
3.00000000
54.40000153
2.00000000
5.00000000
-4.00000000
76.00000000
-23.00000000
43.52999878
-43.52999878
65.43000031

Answers

Explanation:

Here if the value in the register $f2 is equals to the value in $f4, it jumps to the Label1. If it should jump when the value in the register $f2 is NOT equals to the value in $f4, then it should be

which shortcut can we use to make directional heading of a cuboid more obvious while in the lidar view​

Answers

Answer:

cutting across

Explanation:

Which of the following is not the disadvantage of closed
network model?
Select one:
O Flexibility
O Public network connection
O Support
O External access​

Answers

Answer:

public network connection

Answer:

public network connection

is used for finding out about objects, properties and methods​

Answers

Answer:

science

Explanation:

You want a cable that could be used as a bus segment for your office network. The cable should also be able to support up to 100 devices. Which cable should you use?

A.
RG-6
B.
RG-8
C.
RG-58U
D.
RG-59

Answers

Answer: C

Explanation:

what is the best plugin for subscription sites?

Answers

Answer:

Explanation:

MemberPress. MemberPress is a popular & well-supported membership plugin. ...

Restrict Content Pro. ...

Paid Memberships Pro. ...

Paid Member Subscriptions. ...

MemberMouse. ...

iThemes Exchange Membership Add-on. ...

Magic Members. ...

s2Member.

A line beginning with a # will be transmitted to the programmer’s social media feed.

A.
True

B.
False

Answers

Answer:

True?

Explanation:

Answer:

The answer is false.

Explanation:

A “#” doesn’t do that in Python.

One way to add a table to a presentation is to click on Clip Art under the Insert tab. click on WordArt under the Insert tab. right-click on an existing page with content and choose Add Table. add a new slide and left-click on the Table symbol in an empty area.

Answers

Huh? What is this? …..

Page Setup options are important for printing a PowerPoint presentation a certain way. The button for the Page Setup dialog box is found in the
File tab.
Home tab.
Design tab.
Slide Show tab.

Answers

Answer: Design tab

Explanation:

The page setup simply refers to the parameters which are defined by a particular user which is vital in knowing how a printed page will appear. It allows user to customize the page layout. The parameters include size, page orientation, quality of print,margin etc.

It should be noted that page setup options are vital for printing a PowerPoint presentation in a certain way and the button for the Page Setup dialog box can be found in the design tab.

Use the drop-down menus to explain how to set up a lookup field to use a combo box control with a list of options. 1. Open a table in Design view, and right-click a field. 2. Select Change To in the drop-down menu, then select . 3. On the Data tab of the , make a number of choices. 4. For the Row Source Type, choose . 5. For Limit to List, select . 6. For Row Source, click the ellipsis and enter the values in the dialog box that opens. 7. Close the Property Sheet, and save the form.

Answers

Answer:

Combo Box, Property Sheet, Value List, Yes

Explanation:

Use the drop-down menus to explain how to set up a lookup field to use a combo box control with a list of options are the combo box, vause lkist.

What is the distinction between a mixture container and a drop-down listing?

A drop-down listing is a listing wherein the chosen object is constantly seen, and the others are seen on call for via way of means of clicking a drop-down button. A combo container is a mixture of a listing container or a drop-down listing and an editable textual content container, as a consequence permitting customers to go into a fee that isn't always withinside the listing.

A drop-down listing in Access 2013 gives a listing of values to useful resources in statistics access in tables or forms. Although you could permit customers to manually input values that do not exist withinside the drop-down listing, you will want to disable this selection to limition alternatives to tiered values.

Read more about the combo box control:

https://brainly.com/question/17238933

#SPJ2

This program exercise #4 wants the user to write a program in python that contains a list of movies titles, years and movie rating. You will need to display a menu option that allows the user to list all of the movies, add a movie, delete a movie and exit out of the program. This will be done using lists and the functions to add an element to a list and how to delete an element to a list. The program should be written utilizing functions in python for the main function, the display_menu function, the delete function, the add function and the list movie function. You can place this all in one python file or include them in various python files that include them into the main program. Let me know if you have any questions with this exercise. Output Screen: COMMAND MENU list - List all movies add - Add a movie del - Delete a movie exit - Exit program Command List: list 1. Monty Python and the Holy Grail, 1979, R 2. On the Waterfront, 1954, PG 3. Cat on a Hot Tim Roof, 1958, R Command: add Name: Gone with the Wind Year: 1939 Rating: PG Gone with the Wind was added.

Answers

Answer:

The program in Python is as follows:

def display_menu(titles,years,ratings):

   for i in range(len(titles)):

       print(str(i+1)+". "+titles[i]+", "+str(years[i])+", "+str(ratings[i]))

   

def delete(titles,years,ratings):

   del_item = input("Movie: ")

   if del_item in titles:

       print(del_item,"was deleted")

       index = titles.index(del_item)

       titles.pop(index)

       years.pop(index)

       ratings.pop(index)

   return(titles,years,ratings)

   

def add(titles,years,ratings):

   title = input("Title: ")

   year = int(input("Year: "))

   rating = int(input("Ratings: "))

   print(title,"was added")

   titles.append(title)

   years.append(year)

   ratings.append(rating)

   

   return(titles,years,ratings)

titles = []

years = []

ratings = []

print("COMMAND MENU list\nlist - List movies\nadd - Add movie del\ndel - Delete movie exit\nexit - Exit program")

menu = (input("Command List: "))

while(menu.lower() == "list" or menu.lower() == "add" or menu.lower() == "del"):

   if menu.lower() == "list":

       display_menu(titles,years,ratings)

   elif menu.lower() == "add":

       titles, years, ratings = add(titles,years,ratings)

   elif menu.lower() == "del":

       titles, years, ratings = delete(titles,years,ratings)

   menu = (input("Command List: "))

   elif menu.lower() == "exit":

       break

print("Exited!!!")

Explanation:

See attachment for complete program where comments are used to explain some lines of the program

-1
Draw a flowchart to input two
numbers in variables M and N and
print the multiplication table from 1*1
to M*N​

Answers

Answer:A flowchart is a diagram that depicts the steps involved in solving a problem. The following flowchart shows how to output the multiplication table ( n * 1 to m * 1) of a number, n and m:

what does this mean on a tamagotchi lol (this is the hello kitty one)

Answers

I not sure but I think it’s an apple.

I don't have that tamagotchi

But I do have 2 tamagotchi's

I think it's a cherry on your tamagotchi

Hoped this helped!

Have a wonderful day-

a) Why is eavesdropping done in a network?
b) Solve the following using checksum and check the data at the
receiver:
01001101
00101000​

Answers

Answer:

An eavesdropping attack is the theft of information from a smartphone or other device while the user is sending or receiving data over a network.

Missing: checksum ‎01001101 ‎00101000

17. What are the basic modes of operation of 8255?Write the features of mode 0 in 8255?

Answers

Answer:

There are two basic operational modes of 8255:

Bit Set/Reset mode (BSR mode).

Input/Output mode (I/O mode).

Features of 8255 Microprocessor:

Mode 0 : Simple Input/Output.

Mode 1 : Input/Output with handshake.

Mode 2 : Bi-directional I/O data transfer.

It has three 8-bit ports : Port A, Port B, and Port C, which are arranged in two groups of 12 pins.

The 8255 can operate in 3 I/O modes : (i) Mode 0, (ii) Mode 1, & (iii) Mode 2.

What’s unique about windows 8 compared to earlier windows

Answers

New Interface, features like start screen, faster boot time, dynamic desktop, improved search function, windows love syncing, windows to go, and improved security.

write the C program
The function turn_to_letter decides on the letter grade of the student according to the table below from the visa and final grades sent into it and returns it, write it together with a main function which the turn_to_letter function is called and prints the letter equivalent on the screen. -Success score = 40% of midterm + 60% of final,
-F for the success score below 50, D for between 50 and 59, C for between 60 and 69, B for between 70 and 79, A for 80 and above.

Answers

Answer:

The program in C is as follows:

#include <stdio.h>

char turn_to_letter(double score){

   char lettergrade = 'A';

   if(score>=80){        lettergrade = 'A';    }

   else if(score>=70){        lettergrade = 'B';    }

   else if(score>=60){        lettergrade = 'C';    }

   else if(score>=50){        lettergrade = 'D';    }

   else{lettergrade = 'F';}

   return lettergrade;

}

int main(){

   int midterm, final;

   double score;

   printf("Midterm: ");    scanf("%d", &midterm);

   printf("Final: ");    scanf("%d", &final);  

   score = 0.4 * midterm + 0.6 * final;

   printf("Score: %lf\n", score);

   printf("Letter Grade: %c",turn_to_letter(score));

   return 0;

}

Explanation:

The function begins here

char turn_to_letter(double score){

This initializes lettergrade to A

   char lettergrade = 'A';

For scores above or equal to 80, grade is A

   if(score>=80){        lettergrade = 'A';    }

For scores above or equal to 70, grade is B

   else if(score>=70){        lettergrade = 'B';    }

For scores above or equal to 60, grade is C

   else if(score>=60){        lettergrade = 'C';    }

For scores above or equal to 50, grade is D

   else if(score>=50){        lettergrade = 'D';    }

Grade is F for other scores

   else{lettergrade = 'F';}

This returns the letter grade

   return lettergrade;

}

The main begins here

int main(){

This declares the midterm and final scores as integer

   int midterm, final;

This declares the total score as double

   double score;

These get input for midterm score

   printf("Midterm: ");    scanf("%d", &midterm);

These get input for final score

   printf("Final: ");    scanf("%d", &final);  

This calculates the total score

   score = 0.4 * midterm + 0.6 * final;

This prints the calculated total score

   printf("Score: %lf\n", score);

This calls the turn_to_letter function and prints the returned letter grade

   printf("Letter Grade: %c",turn_to_letter(score));

   return 0;

}

what connect webpages?​

Answers

Anchor tags or hyperlinks are used to connect webpages.

Answer:

"Hypertext links are those words that take you from one web page to another when you click them with your mouse. Although the same HTML tag you study in this hour is also used to make graphical images into clickable links, graphical links aren't explicitly discussed here" I got this from https://www.informit.com/articles/article.aspx?p=440289 sorry I couldnt take the time myself here to help :(

Explanation:

You have been given an encrypted copy of the Final exam study guide here, but how do you decrypt and read it???

Along with the encrypted copy, some mysterious person has also given you the following documents:

helloworld.txt -- Maybe this file decrypts to say "Hello world!". Hmmm.

hints.txt -- Seems important.

In a file called pa11.py write a method called decode(inputfile,outputfile). Decode should take two parameters - both of which are strings. The first should be the name of an encoded file (either helloworld.txt or superdupertopsecretstudyguide.txt or yet another file that I might use to test your code). The second should be the name of a file that you will use as an output file. For example:

decode("superDuperTopSecretStudyGuide.txt" , "translatedguide.txt")

Your method should read in the contents of the inputfile and, using the scheme described in the hints.txt file above, decode the hidden message, writing to the outputfile as it goes (or all at once when it is done depending on what you decide to use).

Hint: The penny math lecture is here.

Another hint: Don't forget about while loops...

Answers

Answer:

                                               

Explanation:

               

Which line of code will use the overloaded multiplication operation?

class num:
def __init__(self,a):
self.number = a

def __add__(self,b):
return self.number + 2 * b.number

def __mul__(self, b):
return self.number + b.number

def __pow__(self, b):
return self.number + b.number

# main program
numA = num(5)
numB = num(10)

Which line of code will use the overloaded multiplication operation?

class num:
def __init__(self,a):
self.number = a

def __add__(self,b):
return self.number + 2 * b.number

def __mul__(self, b):
return self.number + b.number

def __pow__(self, b):
return self.number + b.number

# main program
numA = num(5)
numB = num(10)

a) product = numA * numB
b) product = numA.multiply(numB)
c) product = numA.mul(numB

Answers

For multiplication one: product = numA * numB

For the addition: result = numA + numB

got 100 on this ez

(searched all over internet and no one had the answer lul hope this helps!)

Answer: First option: product = numA * numB

second option-numA + numB

Explanation:

Can someone plz answer these questions

Answers

Answer:

11001100 = 204

11111111 = 255

Explanation:

For 11001100:

1*2⁷ + 1*2⁶ + 0*2⁵ + 0*2⁴ + 1*2³ + 1*2² + 0*2¹ + 0*2⁰ = 204

Just replace 1's by 0's in the following calculation to do it for every 8 bit number:

1*2⁷ + 1*2⁶ + 1*2⁵ + 1*2⁴ + 1*2³ + 1*2² + 1*2¹ + 1*2⁰ = 255

If you don't want to do the calculation yourself, you can set the windows calculator in programmer mode, then select binary and key in the number.

Factory Design Pattern Assignment This assignment will give you practice in using the Factory/Abstract Factory Design Pattern. You are going to create a Terraforming program. What does terraform mean

Answers

Answer:

Terraform is an open-source infrastructure as code software tool that enables you to safely and predictably create, change, and improve infrastructure.

Other Questions
multiplying and simplify radicals! if u get it right Ill give brainliest (show work pls!!!) Which sequence of transformations will change figure PQRS to figure PQRS? (5 points)Group of answer choicesCounterclockwise rotation about the origin by 180 degrees followed by reflection over the x-axisCounterclockwise rotation about the origin by 180 degrees followed by reflection over the y-axisCounterclockwise rotation about the origin by 270 degrees followed by reflection over the x-axisCounterclockwise rotation about the origin by 270 degrees followed by reflection over the y-axis Do SOCIALLY DISADVANTAGED people have worse, better or the same health outcomes as people with more privilege? questions 18 pls anyone know it? Name 3 cities that have hosted the Winter Olympics? plzzzzzzzzzzzz What was the purpose of Chavez's hunger strike? NO LINKS/FLIES PLEASE .Morgan pays $25 in monthly fees for her baseball team's uniforms and field rental. What kind of expense is the fee she pays? A. VariableB. IncomeC. FixedD. This would not be an expense. i need an answer.? Literally in 1906, a new bank was chartered with _ in capital stock? You have on hand morphine 500 mg in 500 mL normal saline. You need to administer morphine 80 mg/hour in a continuous IV infusion to a patient with terminal cancer pain. How many milliliters per hour will you set on the controller? Help please will give brainiest!Write the equation of the line in Slope-Intercept form. 3/5 of 3 1/4 is( Thx for the answer :) ) A bookcase contains these books. 36 cookbooks 17 autobiographies39 novels 22 reference books One book is selected at random from the bookcase. Based on the information, which statement is true? A The book is twice as likely to be a cookbook as a reference book. B The book is just as likely to be a novel as it is to be an autobiography or a reference book. C. The book is more likely to be a cookbook than a novel. D. The item is half as likely to be a reference book as a novel. HELP PLZ 20 POINTS!!!!!!!!!!!!!!!!!!!! What was the death march for the Jewish people? A-The train ride to the camps B- The walk from the concentration camps to freedom C- The walk from trains to the concentration camps D-The walk from the concentration camps to Germany 36^x-2=6 solve for x NO LINKS OR WILL BE REPORTED The table below shows the numbers of tickets sold at a carnival and the amounts of money in dollars collected Cost of Carnival Tickets Number of Tickets. Amount $ Collected. 5 $15 10. $30 15. $45 20. $60 25. $75 Which equation represents the relationship A y = x + 10 B y = 5x C y = x + 15 D y = 3x Which statement accurately describes the Battle of Antietam? 4 chef require 10 minutes to prepare 20 desserts. At this rate how many chefs are needed to prepare 75 desserts in 15 minutes?PLS HELP! PLS TELL ME HOW YOU GOT THE ANSWER. THIS IS FOR MY COUSIN. SHE NEEDS HELP. Consider the following system of equations.3x + 5y = 186x 5y = 20Decide which procedures eliminate the x variable and which eliminate the y variable. Drag and drop each procedure that will eliminate one of the variables into the appropriate category.Subtract the second equation from the first equation. Add the first and second equations. Multiply the first equation by 2; then add the two equations. Divide the second equation by 2; then add the two equations. Subtract the first equation from the second equation. Multiply the first equation by 2 then add the two equations. Eliminate x Eliminate y