73 views

Uploaded by DeepakKattimani

- Project Preoposal - Instant Tea
- Business Case Workbook
- Jsm 130108 Full Text
- Cost Benefit Analysis Tool
- Final Project Ranking Report
- Basic Training
- Detailed Business Case
- The Use of Life Cycle Cost Analysis to Determine the Most Effective Cost of Installation High Voltage Undersea Cable Bali Strait
- Project Viability Assessment Worked Example
- Rocky-Mountain-Power--RMP-DTG-6
- a6
- Session 2 - Capacity Planning
- Econimic Feasibility Assessment Methodology
- Unit7-NVRN
- scm_ch04
- Chapter 4 - Time Value of Money
- US Internal Revenue Service: rr-06-10
- Chap 2
- JavaScript Built
- Ginnys Restaurant Case.

You are on page 1of 5

Write a demonstration program that asks the user to select one of three possible inverse functions:

ArcSin, ArcCos, or ArcTan, and subsequently input a trigonometric ratio. If the magnitude of the ratio

is greater than unity, and the desired function was either ArcSin or ArcCos, the program should output

the statement, Magnitude must not be greater than unity. and terminate. If the input function type is

not as, ac, or at, the program should print Not an allowed function and print the angle as

NaN. Otherwise, it should perform the conversion, and output the resulting angle in degrees.

Sample session:

Select ArcSin(as), ArcCos(ac), or ArcTan(at): at

Enter a trigonometric ratio: 50

angle in degrees = 88.8542371618249

2. [after 5.3] Combining Decibels *:

Sound power level is expressed in decibels. A decibel is 10 x log10(picoWatts), where a picoWatt is

10-12 Watts. To determine the acoustical power level produced by the combination of two sound

sources, we do the following:

1.

Convert each decibel level into picoWatts, using the formula, picoWatts = 10(decibels / 10)

2.

Add the picoWatt powers.

3.

Convert the sum back into decibels.

Using good style, create a class called Decibels. In the main method, declare two component decibel

values, dB1 and dB1, both double variables. Also declare a combined decibel value, combinedDB.

Prompt for and input the two component decibel values. Then use the above formulas and Maths pow

method and Maths log10 method to compute the combined sound power level.

Sample session:

Enter first decibel level: 63

Enter second decibel level: 65

Combination decibel level = 67.1244260279434 dB

3. [after 5.5] Variable Name Checker **:

Write a program that checks the properness of a given variable name. More specifically, your

program should specify whether a user-entered variable name is (1) illegal, (2) legal, but uses poor

style, or (3) good. There are different opinions as to what constitutes good style for a variable name.

For this program, check for good style using these rules:

Only use letters and digits.

Use a lowercase letter for the first character.

You dont need to check for an uppercase letter for the first letter in the second word, third word, etc.

Sample session:

This program checks the properness

Enter a variable name (q to quit):

Good!

Enter a variable name (q to quit):

Illegal.

Enter a variable name (q to quit):

Legal, but uses poor style.

Enter a variable name (q to quit):

Illegal.

Enter a variable name (q to quit):

Legal, but uses poor style.

Enter a variable name (q to quit):

streetAddress2

street address2

StreetAddress2

2ndStreetAddress

street$address$2

q

Implement a program that reads phone numbers, and for each phone number, it displays the phone

numbers three components country code, area code, and local number. See the sample session for

details.

You may assume that the user enters each phone number as a series of digits and dashes, such that there

are three groups of digits and two dashes separating the three groups. For example, 1-816-7412000. The

first digit group (1 in the example) is the country code, the second digit group (816 in the example) is the

area code, and the third digit group (7412000 in the example) is the local phone number.

You may not assume that the number of digits in a particular digit group is fixed. For example, the

country code for the United States requires one digit (1) and the country code for China requires two

digits (86).

Sample session:

PHONE NUMBER DISSECTOR

Enter a phone number in the form cc-area-local,

where cc = country code digits, area = area code digits,

and local = local phone digits.

Or enter q to quit:

1-816-7412000

country code = 1

area code = 816

local phone number = 7412000

Enter a phone number in the form cc-area-local,

where cc = country code digits, area = area code digits,

and local = local phone digits.

Or enter q to quit:

86-131-12345678

country code = 86

area code = 131

local phone number = 12345678

Enter a phone number in the form cc-area-local,

where cc = country code digits, area = area code digits,

and local = local phone digits.

Or enter q to quit:

Q

5.

Implement a more robust version of the above phone number program. More specifically, allow for

shortened phone numbers phone numbers that have just a local digit group and nothing else, and phone

numbers that have just a local digit group and an area code and nothing else. If the user enters just one

digit group, your program should print question marks for the country code and area code. If the user

enters two digit groups, your program should print a question mark for the country code. See the sample

session for details.

Sample session:

PHONE NUMBER DISSECTOR

Enter a phone number in the form cc-area-local,

where cc = country code digits, area = area code digits,

and local = local phone digits.

Or enter q to quit:

816-7412000

country code = ?

area code = 816

local phone number = 7412000

Enter a phone number in the form cc-area-local,

where cc = country code digits, area = area code digits,

and local = local phone digits.

Or enter q to quit:

12345678

country code = ?

area code = ?

local phone number = 12345678

Enter a phone number in the form cc-area-local,

where cc = country code digits, area = area code digits,

and local = local phone digits.

Or enter q to quit:

q

Implement a program that calculates the net present value for a proposed project.

Before undertaking an expensive project, it is common for business financial analysts to calculate the

net present value for the proposed project. The net present value tells the business financial analyst

whether it would be wise to go forward with the project or not. A positive net present value says to go

forward. A negative net present value says that the business would make more money by not going

forward, and, instead, investing the proposed projects expenses in the financial markets.

To calculate a projects net present value, you first need to obtain the projects estimated net cash

flow values. Net cash flow is the projects income or loss at a particular time t. Here is an example,

which shows 6 estimated net cash flow values for the life of a proposed project:

Year 2012 = -$100,000 initial investment (cash outflow)

Year 2013 = +$40,000 income (cash inflow)

Year 2014 = +$40,000 income (cash inflow)

Year 2015 = +$40,000 income (cash inflow)

Year 2016 = +$20,000 income (cash inflow)

Year 2017 = +$50,000 sale of remaining assets (cash inflow)

After obtaining net cash flow values, the next step in finding a projects net present value is to

calculate the present value for each of its net cash flow values. The present value is today's equivalent

value of an amount of money at a particular time in the future. You may have heard of the effect of

compound interest. Compound interest converts a present value to a greater future value. Finding

present value is just going the other way converting future dollars back to equivalent present

dollars. If that doesnt make sense, thats OK. Just use this formula to calculate the present value for a

net cash flow at year y in the future:

Where:

Cy is the net cash flow at year y

r is the discount rate, which is the estimated rate of return that could be earned on an

investment in the financial markets

y present year is the cash flows year minus the current year

Note: The above formula refers to the present value and the net cash flow value at a particular year y.

Present values and the net cash flow values are sometimes specified at non-yearly intervals, but its

common to simplify matters by sticking to yearly intervals and thats what we do.

The final step in finding a projects net present value is to sum all of the projects present values.

To see if you now understand how to calculate a net present value, use the six net cash flow values

shown in the above example, use a discount rate of .06 (meaning that you anticipate a 6% annual

return if you invest money in the financial markets), and use a present year of 2010. You should come

up with a net present value of +53,511.27.

As always, your programs output format must: mimic the sample sessions precisely. In particular, note

the spaces and the net present values plus or minus sign. You can generate the plus or minus sign with an

if else statement, or you can generate it by using a particular printf flag. To learn about all of

printfs flags, search the Formatter class on Suns Java API web site.

Sample session:

Enter present year: 2010

Enter discount rate as a fraction: .06

Enter year of net cash flow: 2012

Enter net cash flow: -100000

Any more cash flows (y/n)? y

Enter year of net cash flow: 2013

Enter net cash flow: 40000

Any more cash flows (y/n)? y

Enter year of net cash flow: 2014

Enter net cash flow: 40000

Any more cash flows (y/n)? y

Enter year of net cash flow: 2015

Enter net cash flow: 40000

Any more cash flows (y/n)? y

Enter year of net cash flow: 2016

Enter net cash flow: 20000

Any more cash flows (y/n)? y

Enter year of net cash flow: 2017

Enter net cash flow: 50000

Any more cash flows (y/n)? n

Net present value = +53,511.27

Another sample session:

Enter present year: 2010

Enter discount rate as a fraction: .1

Enter year of net cash flow: 2010

Enter net cash flow: -100000

Any more cash flows (y/n)? n

Net present value = -100,000.00

- Project Preoposal - Instant TeaUploaded bybig john
- Business Case WorkbookUploaded byMeknouniMehdi
- Jsm 130108 Full TextUploaded byKuldeep Singh
- Cost Benefit Analysis ToolUploaded byMuhammad Ejaz
- Final Project Ranking ReportUploaded byGiridhar Singh
- Basic TrainingUploaded bySiddharth
- Detailed Business CaseUploaded bysandy_skvv
- The Use of Life Cycle Cost Analysis to Determine the Most Effective Cost of Installation High Voltage Undersea Cable Bali StraitUploaded byaryo_el06
- Project Viability Assessment Worked ExampleUploaded byokucuanthony
- Rocky-Mountain-Power--RMP-DTG-6Uploaded byGenability
- a6Uploaded byanika fierro
- Session 2 - Capacity PlanningUploaded byRaphael Sison
- Econimic Feasibility Assessment MethodologyUploaded byprannoy
- Unit7-NVRNUploaded byNag Raju
- scm_ch04Uploaded bysummiasaleem
- Chapter 4 - Time Value of MoneyUploaded byRyaud Ally
- US Internal Revenue Service: rr-06-10Uploaded byIRS
- Chap 2Uploaded bytanvir09
- JavaScript BuiltUploaded byRaj Bangalore
- Ginnys Restaurant Case.Uploaded bys_gonzalez75
- September 2Uploaded byHerman
- RiskaWidyawati-CH3Uploaded byKhoirun Nisa'ul Afifah
- Fin Exam AUploaded bytahaalkibsi
- LeasingUploaded byVaidyanathan Ravichandran
- MODULE - AUploaded byRahul Singh
- Sample_Quiz_CH_13.docUploaded byjklein2588
- Scorpio PDFUploaded byAzlinda Jonathan
- Chap 001Uploaded byKyren Greigg
- POFUploaded byhectorgm77
- C-2004-07-0-1Uploaded byDerek Wong

- Chapter 9 ProjectsUploaded byDeepakKattimani
- Chapter 6 ProjectsUploaded byDeepakKattimani
- Chapter 4 ProjectsUploaded byDeepakKattimani
- Chapter 10 ProjectsUploaded byDeepakKattimani
- Chapter 11 ProjectsUploaded byDeepakKattimani
- Chapter 15 ProjectsUploaded byDeepakKattimani
- Chapter 16 ProjectsUploaded byDeepakKattimani
- Chapter 12 ProjectsUploaded byDeepakKattimani
- Chapter 3 ProjectsUploaded byDeepakKattimani
- Chapter 7 ProjectsUploaded byDeepakKattimani
- Chapter 13 ProjectsUploaded byDeepakKattimani
- Chapter 17 ProjectsUploaded byDeepakKattimani
- Notes on Flow ChartUploaded bySourav Roy
- Chapter 14 ProjectsUploaded byDeepakKattimani
- Chapter 8 ProjectsUploaded byDeepakKattimani
- TCP_IP Protocol Suite _ Chapter 17 - Multiple Choice QuizUploaded byDeepakKattimani
- 10.1 Ventilation Surveys - Undergound Ventilation SurveyUploaded byDeepakKattimani
- Lecture 3= Head and power characteristics of centrifugal fansUploaded byDennise Shughni
- 8.8 Mechanical Ventilation - Booster FansUploaded byDeepakKattimani
- 8.7 Mechanical Ventilation - Auxiliary VentilationUploaded byDeepakKattimani
- Lecture 5= Fan characteristics curvesUploaded byDennise Shughni
- 10.3 Ventilation Surveys - Air Quality and Quantity SurveysUploaded byDeepakKattimani
- 9.1 Ventilation Netword Analysis - Series and Parallel AirwaysUploaded byDeepakKattimani
- 10.2 Ventilation Surveys - Equipments Used for Ventilation SurveysUploaded byDeepakKattimani
- TCP_IP Protocol Suite _ Chapter 06 - Multiple Choice QuizUploaded byDeepakKattimani
- Lecture 4= Fan lowsUploaded byDennise Shughni
- 8.6 Mechanical Ventilation - Selection of Mine FansUploaded byDeepakKattimani
- 9.2 Ventilation Netword Analysis - Network AnalysisUploaded byDeepakKattimani
- Cdac CourseUploaded byDeepakKattimani

- Motion Based Animal Detection in Aerial VideosUploaded bylogu_thalir
- Sample Math IA IB 2Uploaded byNana_Patekar69
- 462 NotesUploaded byJhonny Corregidor
- Optimization of Uniform Fiber Bragg Grating Reflection Spectra for Maximum Reflectivity and Narrow BandwidthUploaded byInternational Journal of computational Engineering research (IJCER)
- 23 Optimal Sizing and Placement of Distributed Generation in a Network System (1)Uploaded byNikola Andjelic
- 19761Uploaded byrambabs369
- Interactive Consistency With Multiple Failure ModesUploaded bySakura2709
- EE 483Uploaded byరవితేజ నంబూరు
- EnhancementImage EnhancementUploaded byHyder Baset
- Class 10 First Term Syllabus 21-07-2018Uploaded byBhumika D
- 5th Grade Unit 2 Performance TaskUploaded byJudah Lazaga
- Appendix lUploaded bykuzu76
- 55812859-MohdAriffananMFKE2008Uploaded byLau_Wee_Keong_1836
- Youngsik Huh- Lattice Stick Numbers of KnotsUploaded byYokdm
- FINAL 1curriculum Checklist for CHED BPEdaugst 1Uploaded byAnonymous PcPkRpAKD5
- R-REC-P.1057-2-200708-I!!PDF-EUploaded byAlexander Lopez
- Journal of Computer Science IJCSIS Vol. 11 No. 12 December 2013Uploaded byijcsis
- thinning of arabic charactersUploaded byapi-3754855
- Reliability AllocationUploaded byoecoepkj
- Liu_Uji Fenol Dan IC50_Optimization of Ultrasonic Extraction of Phenolic Compounds From Euryale Ferox Seed Shells Using Response Surface MethodologyUploaded byDian Rahmat Yuneri
- Mathematics (2)Uploaded byBapa Lolo
- 3.2.Cournot ModelUploaded bychetana
- Order StatisticsUploaded bynitin30
- Quantum Optics - KayUploaded byPingtung Roberto
- Notas para tornería segmentada de la maderaUploaded byCasilisto
- Generalized Neutrosophic Contra-ContinuityUploaded byMia Amalia
- Carbon Foam Tooling for Aerospace CompositesUploaded byJavier Heredia
- Diagnostic TestingUploaded byDisha Awate
- New Microsoft Word Document (2)Uploaded byjobi xavier
- MixSimUploaded byJose Alirio