1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
hammer [34]
2 years ago
9

Given a one-dimensional array named yearlySalesTotals that contains decimal values, code the first line of a for statement that

declares an index, a Boolean expression for ending the for loop, and an increment expression that lets you use the index to refer to each element in the array.
Computers and Technology
1 answer:
VashaNatasha [74]2 years ago
7 0

Answer:

for(int i =0; i<yearlySalesTotals.length;i++)

Explanation:

The for statement in has the syntax as given above, it has an int variable indicating the starting index, then a boolen condition ensuring that you don't get out of the array bounds, and an increment operator.

See below a complete program in java that will output all elements of the array  assuming the array yearlySalesTotals contains only ten elements and all indexes has been assigned values.

public class ANot {

   public static void main(String[] args) {

double []yearlySalesTotals = new double[10];

for(int i = 0; i<yearlySalesTotals.length; i++){

   System.out.println(yearlySalesTotals[i]);

   }

}

}

You might be interested in
PLEASE HELP ME ASAP!!! Looking at the misty rain and fog (pictured above) Explain at least two defensive driving techniques you
JulsSmile [24]
1.Slow down 2. Break earlier
7 0
3 years ago
Give any 3 examples of mainframe computers .
Eddi Din [679]
3 Examples of mainframe computers
z900
System z9
System z10
5 0
3 years ago
NEED HELP ASAP!
Marrrta [24]
Six inches is the answer
8 0
3 years ago
What is 4991 rounded to the nearest thousand
evablogger [386]

Answer:

5000

Explanation:

5 0
3 years ago
Read 2 more answers
A custom window shade designer charges a base fee of $50 per shade. In addition, charges are added for certain styles, sizes, an
jeka94

Answer:

Check the explanation

Explanation:

* Filename: ShadeDesigner.java

* Programmer: Jamin A. Bishop

* Date: 3/31/2012

* version 1.00 2012/4/2

*/

import java. awt.*;

import java. awt. event.*;

import java. text. DecimalFormat;

import javax. swing.*;

import javax. swing. event. ListSelectionEvent;

import javax. swing. event. ListSelectionListener;

public class ShadeDesigner extends JFrame

{

private String[] styles = {"Regular Shades", "Folding Shades", "Roman Shades"};

private String[] size = {"25 Inches Wide", "27 Inches Wide",

"32 Inches Wide", "40 Inches Wide"};

private String[] colors = {"Natural", "Blue", "Teal",

"Red", "Green"};

private JLabel banner;// To display a banner

private JPanel bannerPanel;// To hold the banner

private JPanel stylesPanel;//

private JPanel sizePanel;//

private JPanel colorPanel;

private JPanel buttonPanel;//

private JList stylesList;

private JList sizeList;

private JList colorList;

private JTextField Styles;

private JTextField Size;

private JTextField Color;

private JButton calcButton;

private JButton ExitButton;

private double totalCharges = 50.00;

//Constants

private final int ROWS = 5;

private final double regularCost = 0.00;//base price for the blinds

private final double foldingCost = 10.00;//extra cost for folding blinds

private final double romanCost = 15.00;//extra cost for roman blinds

private final double twentyfiveInCost = 0.00; //extra cost for 25" blinds

private final double twentySevenInCost = 2.00;//extra cost for 27" blinds

private final double thirtyTwoInCost = 4.00;//extra cost for 32" blinds

private final double fourtyInCost = 6.00;//extra cost for 40" blinds

private final double naturalColorCost = 5.00;//extra cost for color

public ShadeDesigner()

{

//display a title

setTitle("Shade Designer");

// Specify what happens when the close button is clicked.

setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

// Create the banner on a panel and add it to the North region.

buildBannerPanel();

add(bannerPanel, BorderLayout. NORTH);

stylesPanel();

add(stylesPanel, BorderLayout. WEST);

sizePanel();

add(sizePanel, BorderLayout. CENTER);

colorPanel();

add(colorPanel, BorderLayout. EAST);

buttonPanel();

add(buttonPanel, BorderLayout. SOUTH);

pack();

setVisible(true);

}

//build the bannerpanel

private void buildBannerPanel()

{

bannerPanel = new JPanel();

bannerPanel.setLayout(new FlowLayout(FlowLayout.CENTER));

banner = new JLabel("Shade Designer");

banner.setFont(new Font("SanSerif", Font.BOLD, 24));

bannerPanel.add(banner);

}

//stylepanel

private void stylesPanel()

{

JLabel styleTitle = new JLabel("Select a Style.");

stylesPanel = new JPanel();

stylesPanel. setBorder(BorderFactory. createEmptyBorder(5,5,5,5));

stylesList = new JList (styles);

stylesList.setVisibleRowCount(ROWS);

JScrollPane stylesScrollPane = new JScrollPane(stylesList);

stylesList. setSelectionMode(ListSelectionModel.SINGLE_SELECTION);

stylesList. addListSelectionListener(new stylesListListener());

stylesPanel. setLayout(new BorderLayout());

stylesPanel. add(styleTitle, BorderLayout. NORTH);

stylesPanel. add(stylesScrollPane, BorderLayout. CENTER);

Styles = new JTextField (5);

Styles. setEditable(false);

//stylesPanel. add(StylesLabel, BorderLayout. CENTER);

stylesPanel. add(Styles, BorderLayout. SOUTH);

}

private class stylesListListener implements ListSelectionListener

{

public void valueChanged (ListSelectionEvent e)

{

String selection = (String) stylesList. getSelectedValue();

Styles. setText(selection);

}

}

//size panel

private void sizePanel()

{

JLabel sizeTitle = new JLabel("Select a Size.");

sizePanel = new JPanel();

sizePanel. setBorder(BorderFactory. createEmptyBorder(5,5,5,5));

sizeList = new JList (size);

sizeList.setVisibleRowCount(ROWS);

JScrollPane stylesScrollPane = new JScrollPane(sizeList);

sizeList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);

sizeList.addListSelectionListener(new sizeListListener());

sizePanel. setLayout(new BorderLayout());

sizePanel. add(sizeTitle, BorderLayout. NORTH);

sizePanel. add(stylesScrollPane, BorderLayout. CENTER);

//sizeLabel = new JLabel("Style Selected: ");

Size = new JTextField (5);

Size.setEditable(false);

//stylesPanel. add(StylesLabel, BorderLayout. CENTER);

sizePanel. add(Size, BorderLayout. SOUTH);

}

private class sizeListListener implements ListSelectionListener

{

public void valueChanged (ListSelectionEvent e)

{

String selection = (String) sizeList. getSelectedValue();

Size. setText(selection);

}

}

6 0
3 years ago
Other questions:
  • If you use the ___ template, as opposed to a formatted theme, you must make all design decisions?
    15·1 answer
  • Google Ads was designed to deliver three things to every advertiser: relevance, control, and results. It provides relevance by c
    11·1 answer
  • . One of the vulnerabilities the Morris worm used was a networking service called finger. The purpose of the finger service is t
    11·1 answer
  • What type of account should you use fro signing in to your windows 8 computer if you want to synchronize your settings on other
    6·1 answer
  • In Python, if var1 = "Happy" and var2= "Birthday" and var3 = (var 1+var2) *2, then var3 stores the string
    6·1 answer
  • What are listed in the vertical columns across the top of the Event Editor?
    5·2 answers
  • Write a program that ask the user to enter air water or Steele and the distance that a sound wave will travel in the medium the
    9·1 answer
  • bro i got banned for posting an amazing bulk pic, but this dude literally posted an inappropriate, dafuq is wrong with this bann
    8·2 answers
  • The arrangement of keys on a keyboard, QWERTY reflects the keyboard layout by ________. Group of answer choices using the letter
    12·1 answer
  • Ups developed software called ____ to enable u.s. customs and border protection agents to inspect packages that pass through the
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!