Computers & Internet Logo

Related Topics:

Posted on Apr 10, 2009
Answered by a Fixya Expert

Trustworthy Expert Solutions

At Fixya.com, our trusted experts are meticulously vetted and possess extensive experience in their respective fields. Backed by a community of knowledgeable professionals, our platform ensures that the solutions provided are thoroughly researched and validated.

View Our Top Experts

I need coding with description

C program coding to recognize nested if control statement and display number of levels of nesting

1 Answer

Anonymous

Level 2:

An expert who has achieved level 2 by getting 100 points

MVP:

An expert that got 5 achievements.

Governor:

An expert whose answer got voted for 20 times.

Scholar:

An expert who has written 20 answers of more than 400 characters.

  • Expert 123 Answers
  • Posted on Apr 12, 2009
Anonymous
Expert
Level 2:

An expert who has achieved level 2 by getting 100 points

MVP:

An expert that got 5 achievements.

Governor:

An expert whose answer got voted for 20 times.

Scholar:

An expert who has written 20 answers of more than 400 characters.

Joined: Apr 10, 2009
Answers
123
Questions
1
Helped
43251
Points
320

The various combinations of these attributes may result in code that looks something like this: sub calcPay(emp) // Calculate pay subroutine if emp.isManager // field reference if emp.isExempt if emp.isPartTime foo_1 else foo_2 end if else // non-exempt if emp.isPartTime foo_3 else foo_4 end if end if else // non-mgr if emp.isExempt if emp.isPartTime foo_5 else foo_6 end if else // non-exempt if emp.isPartTime foo_7 else foo_8 end if end if end if end sub Here we have 8 different "cells" based on all possible combinations of the 3 attributes. (Note that some cells may be error messages for invalid combinations.) Variations of this structure are not uncommon. Thus the question: how does one "fix" it? One approach is to convert every IF block into a separate subroutine. sub calcPay() if emp.isManager doManager() else // non-mgr doNonManager() end if end sub //----------------- sub doManager() if emp.isExempt doMgrExempt() else // non-exempt doMgrNonExempt() end if end sub //----------------- sub doMgrExempt() if emp.isPartTime foo_1 else foo_2 end if end sub //----------------- sub doMgrNonExempt() if emp.isPartTime foo_3 else foo_4 end if end sub // etc.....

Add Your Answer

×

Uploading: 0%

my-video-file.mp4

Complete. Click "Add" to insert your video. Add

×

Loading...
Loading...

Related Questions:

0helpful
1answer

How to stop a thermostat from self setting

Different Nest thermostat models give you different options for setting up a temperature schedule that meets your needs:
  • Auto-Schedule (Nest Thermostat E and Nest Learning Thermostat only)
  • Basic Schedule (for Nest Thermostat E only)
  • Quick schedule (Nest Thermostat only)
0helpful
1answer

My hotpoint washer WMFUG942 has displayed error code F06 and has flooded my kitchen due to the water from my machine expelling through the kitchen sink during the cycle thanks

Please check for rodent nest. For some reason bugs and small rodents love to nest in areas of resistance..actuators..rexepticles..plug ins..sounds dangerous for the newborns right? Thing is its that old nest that is your problem now. It degrades and chunks jam here and there then stuff stops working. Adverse weather forces creatures to seek temperary shelter especially if a birthing event is looming. So don't try to stop it as nature always wins..but inspect your appliance as soon as you notice a change in performance before that nest costs you a days wages.
0helpful
1answer

I want to connect a NEST thermostat with WiFi to my Lennox furnace. The existing iComfort by lennox has 4 wires, R, I+, I-, and C. Where would these connect on the Nest?

They don't. And why would you want to trade it out??? You are currently running off the communicating terminals. If you are going to install a nest you will have to match the nest wiring with the legacy/24volt terminals on the furnace control board and likely the outdoor unit will need rewired as well. Not extremely difficult but why??? The nest is not what it's cracked up to be!!

If you need further help, reach me via phone at https://www.6ya.com/expert/thomas_092728000e6acb79

0helpful
2answers

My bobbin isn't sewing correctly

If the bobbin stitches look out of whack, your machine is probably threaded incorrectly. rethread with the presser foot up and see if this fixes the problem.
1helpful
2answers

New Nest thermostat, Model 2.8 Software version 4.0.1 keeps getting a low battery and shuts off and shuts down the furnace. Please help.

Do you have a common wire? The nest thermostat needs the common 24V C wire installed to keep the battery charged fully. Nest should tell consumers of this problem, but they don't. Its required for any powered thermostat. Even the new fancy Honeywells with touch screens etc..

Gotta realize the battery cannot run the display and wifi plus all the sensors for very long.
0helpful
1answer

Differentiate between nested and inner classes.Explain with examole

best shot that can attempt, hope it helps

Nested Classes vs. Inner Classes
A nested class is a class whose definition appears inside the definition of another class, as if it were a member of the other class. For example, if a program contains class A { class B { // fields, methods of class B... } // fields, methods of class A... } then class B is a nested class of class A. Code outside of the methods of class A can refer to class B by calling it A.B, using the same dot notation as for field and method references. Within the methods of class A class B can be used without qualifying the name. B could be hidden from code outside of class A by declaring it private, just as with fields and methods.
A nested class like B is known as an inner class. An inner class has access to the fields of an instance of its enclosing class. For this reason, an instance of B can only be created in association with an instance of A, using the expression /it instanceA.new A.B(...) outside of A's methods, where instanceA is an instance of A, and
new B(...) inside of A's methods. The new instance of B also knows about the enclosing instance of A, and can refer to it using the expression
A.this We can think of an instance of an inner class as having two this pointers, one for itself and one for its enclosing instance. An inner class may be nested within another inner class, so an inner class can even have multiple levels of this pointers. A nesting depth more than one level is quite uncommon, however, and should usually be avoided.
A nested class can be declared static, in which case it has reduced access to its enclosing class. For example, if B were declared static above, it could no longer access the instance variables of A, and there would be no associated instance A.this. Static nested classes are known as nested top-level classes, because they are exactly like classes declared outside any other class, except for the way they are named. Instances of a static nested class are created using regular new, as in new A.B(...)
0helpful
1answer

About nests

That's when you forget to add endif after the IF statement
0helpful
1answer

View

Views are essentially pre-written select statements, and select statements are limited to 256 tables.

There are a couple of other limits on views as well:

The number of columns in the view is limited to 1024.

Views can be nested (that is, a view selecting out of another view) 32 levels deep.
Not finding what you are looking for?

159 views

Ask a Question

Usually answered in minutes!

Top Computers & Internet Experts

Grand Canyon Tech
Grand Canyon Tech

Level 3 Expert

3867 Answers

Brad Brown

Level 3 Expert

19187 Answers

Cindy Wells

Level 3 Expert

6688 Answers

Are you a Computer and Internet Expert? Answer questions, earn points and help others

Answer questions

Manuals & User Guides

Loading...