Write a function named getaddress

Assignment Help JAVA Programming
Reference no: EM13984510

Command Line JavaScript.

1. Suppose a web service returns JSON data in the following format: person.json.

(A) Write a function named getAddress that accepts an argument of type person and returns the person's address as a string.

getAddress(p) => "21 2nd Street, Portland, OR 90021"

(B) Write a function named getTelNums that accepts an argument of type person and returns a string of telephone numbers for that person. getTelNums(p) => "212.555.1234 646.555.4567 541.502.1212 541.406.8765"

Note that some people may not have a telephone number, some may have just one, and some may have multiple telephone numbers. Your function should handle all cases.

2. 111/p5/triangle-ops-app.html, 111/p5/triangle-opsinfo.html, 111/p5/triangle-ops-app.js, 111/p5/triangleops.css.

Download the four files contained in the Mobile Web App Demo to your 111/p5/ folder, and open them in Sublime.

A) Save logic-ops-app.html as triangle-ops-app.html. Modify this web page as follows:

i) modify the range of the sliders to 1 .. 20.

ii) modify the buttons to read, Legal Triangle?, Area?, Triangle Type?, and 3:4:5 Triangle?

iii) replace Truth Value: with Function Result:

iv) replace all references to logic or binary ops with references to triangle ops.

B) Save logic-ops-app.js as triangle-ops-app.js. Replace the logic operator functions with your function definitions from Project 4. You will need a fourth function named, is345Triangle, that accepts three sides (floating point numbers are OK) and returns true if they are in the ratio of 3:4:5. Read the definition of 3:4:5 triangles.

Each of the buttons when clicked, should display the appropriate value at the bottom of the mobile app.

C) Save logic-ops-info.html as triangle-ops-info.html. Replace the content with a description of your four triangle operators.

D) Persistent NavBars in jQuery Mobile. The navbar at the top of the .html pages is a jQuery Mobile persistent navbar. It will only function correctly when your app is hosted on a server. If you open the app using the file:// protocol, you will get an XHR (ajax) page load error. Your navbar will work correctly when served from uoregon.edu, if you have the landing pages defined correctly.

E) Save logic-ops.css as triangle-ops.css. No changes to the CSS code are required, but no penalty for being creative.

3. 111/p5/ntheory-ops-app.html, 111/p5/ntheory-opsinfo.html, 111/p5/ntheory-ops-app.js, 111/p5/ntheoryops.css.

A) Save logic-ops-app.html as ntheory-ops-app.html. Modify this web page as follows:

i) replace the sliders with a single input widget of type number. Set the max value to 1000.

ii) modify the buttons to read, Deficient?, Perfect?, Abundant?, and Prime?

iii) replace Truth Value: with Function Result:

iv) replace all references to logic or binary ops with references to number theory ops.

B) Save logic-ops-app.js as ntheory-ops-app.js. Replace the logic operator functions with four function definitions, isDeficient, isPerfect, isAbundant and isPrime. Each of these functions can be written using only a single return statement, as described in class Tuesday of week 8 (get the notes from a someone who was there if you were not).

Each of the buttons when clicked, should display the appropriate value at the bottom of the mobile app.

C) Save logic-ops-info.html as ntheory-ops-info.html. Replace the content with a description of your four number theory operators.

D) Persistent NavBars in jQuery Mobile. The navbar at the top of the .html pages is a jQuery Mobile persistent navbar. It will only function correctly when your app is hosted on a server. If you open the app using the file:// protocol, you will get an XHR (ajax) page load error. Your navbar must work correctly when served from uoregon.edu.

E) Save logic-ops.css as ntheory-ops.css. No changes to the CSS code are required, but no penalty for being creative, either.

4. 111/p5/Dice-namic.html, 111/p5/Dice-namic.js. This is an exercise in Client-Side JavaScript. It uses jQuery but not jQuery Mobile. Save your Dice.js file from Project three as Dice-namic.js.

A) Create a web page with the following elements: An h2 header, two img elements, an input box, and a button element.

When the page loads, Dice.getURL is called twice to get the URL for the 1-dot die, and the jQuery.attr() function is used to display the images when the page loads:

112_javascript.png

When the user enters a target number and clicks Roll 'em!, the images are updated die-namically and the results displayed in a div on the page:

1224_javascript1.png

5. Optional, Not Required: 111/p5/Dice-namic-XC.js.

When the user gets lucky and hits her/his number in one roll, use the singular form when displaying the number of rolls. Hint: use the conditional operator (?:).

399_Untitled.png

Reference no: EM13984510

Questions Cloud

Explore in depth the nodes-assets : You have depicted a specific network from within your sector graphically and presented your depiction to your classmates and instructor. This week, you will explore in depth the nodes, assets, and links within your selected network.
What is equivalent annual annuity of profitable project : What is the equivalent annual annuity of the most profitable project - Project L has an expected life of 4 years with after tax cash flows of 5,200 at the end of each year of the next 4 years.
Comparing performance during the first five months : When comparing performance during the first five months of 2013 with performance in 2012, which warehouse shows the most improvement?
Share performance information with suppliers : Many companies are now using the World Wide Web to share performance information with suppliers, thereby allowing suppliers to compare their performance to other suppliers'
Write a function named getaddress : Write a function named getTelNums that accepts an argument of type person and returns a string of telephone numbers for that person. getTelNums(p) => "212.555.1234 646.555.4567 541.502.1212 541.406.8765"
What is the cost of internal common equity for pathos : The dividends and earnings per share are projected to have an annual growth rate of 15 percent. What is the cost of internal common equity for Pathos?
Analyze the cultural differences between the countries : Analyze the cultural similarities and differences that exist between the countries and the United States using Geert Hofstede's 6 Dimensions as discussed in class.
Formal marketing plan to an executive committee : Your marketing plan should be crafted as if you were submitting a formal marketing plan to an executive committee, board members or investors in the marketing initiative. The marketing plan should be of the highest caliber and exhibit the utmost o..
Problem regarding the high-voltage equipment : Congratulations! You have just become the safety manager for Podunk University. Your position is at the campus in Podunk, Colorado, and your predecessor left the job a year and a half ago.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Scrolling applet on the web page

The Earth Observatory System is the study of the earth resources. Science information about the air we breath,

  Write the program with java class and filename pythagorasxy

Write pseudocode in a text editor that shows the program sequence: 1) output explanation of the program purpose, 2) query the user for the sides of the triangle, 3) compute the length of the hypotenuse, 4) output the result.

  Write the definition of the class inventory

Write the definition of the class Inventory such that object of this class can store an item's id, name, number of pieces in stock, manufacturer's price, and selling price. The class should include constructors, setters, getters, and toString meth..

  Controlling and using the paintcomponent ( ) method

How to paint the screen -Controlling and using the paintComponent ( ) method Deliverables app.java, myJFrame.java, myJPanel.java,  and other necessary Java files

  Draw a uml diagram of each of the shapes

Draw a UML diagram of each of the Shapes, Rectangle and Square classes using the code that has been provided. Complete this using the examples that have been provide in the lecture slides - Sample program is provided that creates a list of shapes ..

  Sample papaer hello can you please help me to solve this

hello can you please help me to solve this sample paper and there is not submit date as this is for me but still i want

  Application that inputs ten numbers from the user

Write an application that inputs ten numbers from the user, each number can be between 10 and 100, inclusive. As each number is read in determine if it is a number already entered.

  Online banking management system - java project

Online Banking Management System Java Project - Identify Technical Advisor by name, contact information, position and responsibility

  Better with age

You and your roommates, all at least 21 years of age, have gotten hooked brewing your own beer from kits. You've made quite a few batches, each from a different mix,

  Write java dice program

write java dice program.

  A statement telling the user if they get a discount or not

The program asks the user if they have pre-registered for a conference. If the user has pre-registered, the program should call a method named discount () that displays the message "You are pre-registered and qualify for a 10% discount.

  Build an android application to execute some of the queries

Build an android application to execute some of the queries -

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd