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
Readme [11.4K]
3 years ago
6

Assuming arrayName is the name of an array and identifier is a name of a variable that has the same data type as the array eleme

nts, which of the follow is the correct syntax for the range-based for loop?
a) for (dataType identifier : arrayName) statements
b) for (dataType : arrayName) statements
c) for (identifier : arrayName) statements
d) for (arrayName : dataType identifier) statements
Computers and Technology
1 answer:
creativ13 [48]3 years ago
5 0

Answer:

The answer is "Option a"

Explanation:

Range-based for loop performs a sequence for a loop. It's more accessible as the conventional loop, for example, all components in the array, running more than a range of possibilities. In the given question "option a" is correct because it follows the correct syntax and other choices were wrong, which can be described as follows:

  • In option b, It's not correct, because in this code the range declaration is wrong.
  • In option c, It is wrong, because in this code the datatype is missing.  
  • In option d, It is illegal syntax, that's why it is wrong.
You might be interested in
A cycle merchant allows 15% discount on the marked price of a bicycle and still he makes a profit
lions [1.4K]

Answer:

The program in Java is as follows:

public class Main{

public static void main(String[] args) {

 double discount_percent = 0.15;

 double discount_amount = 600;

 double profit = 0.20;

 double marked_price = discount_amount/discount_percent;

 double cost_price = marked_price/(1 + profit);

 System.out.println("Marked Price: "+marked_price);

 System.out.println("Cost Price: "+cost_price);

}}

Explanation:

For explanation purpose, let

MP \to Marked Price

\%D \to Percentage discount

D \to Discounted amount

\%P \to Percentage Profit

C \to Cost Price

The marked price (i.e. selling price) is calculated discount using:

MP = \frac{D}{\%D}

The derived formula of the cost price from percentage profit and Marked Price is:

C = \frac{M}{1 + \%P * 100}

So, the explanation is as follows:

The next three lines declare and initialize the given parameters

<em>  double discount_percent = 0.15;</em>

<em>  double discount_amount = 600;</em>

<em>  double profit = 0.20;</em>

Calculate marked price

 double marked_price = discount_amount/discount_percent;

Calculate cost price

 double cost_price = marked_price/(1 + profit);

Print marked price

 System.out.println("Marked Price: "+marked_price);

Print Cost price

 System.out.println("Cost Price: "+cost_price);

3 0
3 years ago
Which three of the following are used for mobile Internet access?
AlladinOne [14]
Bluetooth wifi and cell tower
8 0
3 years ago
Read 2 more answers
A popular encryption method used to protect data that travel over a wireless network is ___
ddd [48]

Answer:

The most serious threat to offshore industrial systems is external access to control systems. Unwanted access to the human/machine interface (HMI) can allow third parties full control of a system. Zybersafe provides protection of the integrity of data that traverses the Ethernet connection between a company’s headquarters and a remote system.

4 0
3 years ago
An operating system coordinations the___ of a computers operation
qwelly [4]
\\\\\\\\\\\\\\\\\\\\\\\\\Operating system///////////////////////
                            Is the Answer
8 0
3 years ago
Freeeee BRAINLIESTHBJHBJHB
andre [41]

Answer:A lot of people cry when they cut an onion. The trick is not to form an emotional bond.lol

4 0
3 years ago
Read 2 more answers
Other questions:
  • How can i do a back up on one computer and save it to the hard drive in another computer without it being seen by others on the
    9·1 answer
  • What is daemontools pakage in qmail?
    14·1 answer
  • Web and mobile applications are created for users to only read information. True False
    15·2 answers
  • Which of the following best describes a group?
    13·1 answer
  • What emphasizes extensive user involvement in the rapid and evolutionary construction of working prototypes of a system to accel
    15·1 answer
  • ________type of website is an interactive website kept constantly updated and relevant to the needs of its customers using a dat
    5·1 answer
  • Tennis players are not allowed to swear when they are playing in Wimbledon
    6·2 answers
  • Why do I keep getting points if I haven't answered anything? I don't want points.
    12·1 answer
  • What would be printed to the screen when the following program is run?
    11·1 answer
  • Which statement is true about the energy of electromagnetic radiation?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!