• edited by
127 views
0 0 votes

What is the output if the following JavaScript program is executed by a typical web browser?

namespace LanguageFeatures.
                        Controllers { 
public class HomeController :
                        Controller {
public ViewResult Index() {
object[] data = new object[] { 275 M , 29.95 M , "apple", "orange", 100, 10};
decimal total = 0;
for (int i=0; i < data.Length; i++) {
switch (data[i]) {
case decimal decimalValue:
total += decimalValue;
break;
case int intValue when intValue > 50:
total += intValue;
break;
}       }
return View("Index", new string[]
           {$"Total: {total:C2}" });
}   }  }
  1. $\$ 100.95$
  2. $\$ 404.95$
  3. $\$ 250.95$
  4. Compilation error

Please log in or register to answer this question.

Position:
Show:

Related questions

1 1 vote
0 0 answers
215
215 views
admin asked Oct 19, 2025
215 views
Consider the following statements regarding Binary Search Tree:A height balanced tree is always a Binary Search TreeA complete Binary Search Tree may not be height balanc...
0 0 votes
0 0 answers
141
141 views
admin asked Oct 19, 2025
141 views
Which one of the following statements correctly describes the difference between the DOM and SAX approaches to XML processing ?DOM reads and processes an XML document by ...
0 0 votes
0 0 answers
132
132 views
admin asked Oct 19, 2025
132 views
Which of the following software development models is/are path-based integration testing compatible with?Only traditional waterfall modelsOnly agile modelsOnly object-ori...
0 0 votes
0 0 answers
143
143 views
admin asked Oct 19, 2025
143 views
Consider the following statements regarding ORACLE triggers:Oracle supports both row triggers as well as statement triggersA trigger can be defined as either a before or ...