Questions
Java Prorgramming Skills Looping Branching Use of the length(), indexOf(), and charAt() methods of class String...

Java Prorgramming


Skills

  • Looping
  • Branching
  • Use of the length(), indexOf(), and charAt() methods of class String
  • Use of the static Integer.toHexString method to convert a character to its ASCII hex value

Description

In this assignment, you'll be URL encoding of a line of text. Web browsers URL encode certain values when sending information in requests to web servers (URL stands for Uniform Resource Locator).

Your program needs to perform the following steps:

  1. Prompt for a line of input to be URL encoded
  2. Read the line of text into a String (using the Scanner class nextLine method)
  3. Print the line that was read.
  4. Print the number of characters in the line (using String.length)
  5. Create an output String that is the URL encoded version of the input line (see below for details on encoding).
  6. Print the URL encoded String
  7. Print the number of characters in the encoded String.

To convert a String to URL encoded format, each character is examined in turn:

  • The ASCII characters 'a' through 'z', 'A' through 'Z', '0' through '9', '_' (underscore), '-' (dash), '.' (dot), and '*' (asterisk) remain the same.
  • The space (blank) character ' ' is converted into a plus sign '+'.
  • All other characters are converted into the 3-character string "%xy", where xy is the two-digit hexadecimal representation of the lower 8-bits of the character.

Use a for loop which increments it's index variable from 0 up to the last character position in the input string. Each iteration of the loop retrieves the character at the 'index' position of the input string (call the String class charAt() method on the input string). Use if statements to test the value of the character to see if it needs to be encoded. If encoding is not required, just concatenate it to the output encoded String. If encoding is required, concatenate the encoded value to the output encoded String. For example, if the input character is a blank, you want to concatenate a '+' character to the output encoded String (as described above).

Note: one technique to determine if a character is one that remains the same is to first create an initialized String containing all of the letters (both upper and lower case), digits, and other special characters that remain the same as described above. Then, call the String indexOf method on that String, passing the character to be tested. If -1 is returned from indexOf, the character was not one of those that remains the same when URL encoding.

For those characters that need to be converted into hex format (%xy above), you can call the pre-defined static Integer.toHexString method, passing the character as an argument. It returns the hex value of the character as a String, which you can concatenate to the encoded output String with the accompanying '%' symbol:

    String hexValue = Integer.toHexString(srcChar);
    encodedLine += '%' + hexValue;

Values that are URL encoded in this manner can be URL decoded by reversing the process. This is typically done by a web server upon receiving a request from a browser.

Sample Output

Enter a line of text to be URL encoded
This should have plus symbols for blanks

The string read is: This should have plus symbols for blanks
Length in chars is: 40
The encoded string: This+should+have+plus+symbols+for+blanks
Length in chars is: 40

Enter a line of text to be URL encoded
This should have hex 2f for /

The string read is: This should have hex 2f for /
Length in chars is: 29
The encoded string: This+should+have+hex+2f+for+%2f
Length in chars is: 31

Test Data

Use all the following test data to test your program, plus an example of your own:

This should have hex 2f for /
An encoded + should be hex 2b
123 and _-.* are unchanged
Angles, equals, question, ampersand > < = ? &

Getting started

Before you start writing Java code, it's usually a good idea to 'outline' the logic you're trying to implement first. Once you've determined the logic needed, then start writing Java code. Implement it incrementally, getting something compiled and working as soon as possible, then add new code to already working code. If something breaks, you'll know to look at the code you just added as the likely culprit.

To help you get started with this homework, here's an outline of the logic you'll need (sometime referred to as 'pseudo-code'):

Prompt for the line of input.
Read a line into the input string.

Set the encoded output string to empty.
Loop through each character in the input string.
{
Get the n'th character from the input string (use String's charAt method).

if (the character is a blank)
    concatenate '+' to the encoded output string
else if (the character remains unchanged)
    concatenate the character to the encoded output string
else
    concatenate '%' and the hex encoded character value
    to the encoded output string
}

Print the encoded output string.

Once you understand this logic, start writing your Java code. An example of the steps you could take are as follows:

  1. Create your Java source file with the public class and main() method (like homework 1).
  2. In the main() method, add code to prompt for the input line, read in the line of input, and print it out.
  3. Next, add the for-loop that loops through each character of the input string. You can use the length() method on your input string to get the number of characters in it to control your loop.
  4. The first statement in the loop should call charAt() on the input string to get the next character to examine.
  5. To check things are working ok so far, make the next statement in the loop print out the character position (the for-loop index variable) and character from the string.
  6. Get this much compiled and running first.

With this much done, if you read in a line containing "hello", you'd get output something like this from the temporary output statement within the loop:

char 0 is h
char 1 is e
char 2 is l
char 3 is l
char 4 is o

Once you've got this compiled and working, starting adding the if/else-if/else logic inside the loop to build the encoded output string.

I have this so far.What am I doing wrong here,please let me know. The code has to fit this requirement.

For those characters that need to be converted into hex format (%xy above), you can call the pre-defined static Integer.toHexString method, passing the character as an argument. It returns the hex value of the character as a String, which you can concatenate to the encoded output String with the accompanying '%' symbol:

    String hexValue = Integer.toHexString(srcChar);
    encodedLine += '%' + hexValue;

Values that are URL encoded in this manner can be URL decoded by reversing the process. This is typically done by a web server upon receiving a request from a browser.

I don't how to fit the last requirement

here is my code so far

import java.util.Scanner;

   public class URLEncoding {

       public static final String Notencodedchars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.!~*'()"; }
  
      
       public static void main1(String args[]) {
           System.out.println("Enter a line of text to be URL encoded");
   // Create a scanner to read from keyboard
@SuppressWarnings("resource")
   Scanner sc = new Scanner (System.in);
String input = sc.nextLine();
System.out.println("The String read is :");
System.out.println("Length in chars is: "+input.length());
String Encoded ="";
char c;
for (int indexOf = 0; indexOf < input.length(); indexOf ++) {
  
       char ch = input.charAt(indexOf);
       if(Notencodedchars.indexOf(c) != -1)
               {
  
              
               Encoded += c;
               }
               else
               {
               if(c == ' ')
               //Encoded.concat("+");
               Encoded += '+';
               else
               {
                   public static String toHexString(int i) {
                   return toUnsignedString0(i, 4);
                   }
               private static String toUnsignedString0(int i, int j) {
                           // TODO Auto-generated method stub
                           return null;
                       }
                   String hexValue = Integer.toHexString(srcChar);
               encodedLine += '%' + hexValue;
               }
               }
       System.out.println("The encoded string is :"+ encodedString.toString());

       System.out.println("Length in chars is :" + encodedString.toString().length());

       }

       }


Someone ,please correct this for me.

In: Computer Science

As it relates to C#: Though the function of switch case and else if ladder is...

As it relates to C#:

Though the function of switch case and else if ladder is same, there are a number of  difference between switch case and else if ladder, Explain the differences in two areas such (memory consumption, speed of processing, variable requirement) etc.

In: Computer Science

Please code in c# (C-Sharp) Write a program that will ask the user for their name....

Please code in c# (C-Sharp)

Write a program that will ask the user for their name. If the user does not input anything, display a

warning before continuing. The program will then ask the user whether they want to have an addition,

subtraction, multiplication, or division problem. Once the user indicates their choice, the program will

display 2 randomly generated numbers from 1 to 9 in a math problem matching the user’s choice.

Example: user selects addition, the equation presented is:

(random number from 1 to 9) + (random number from 1 to 9)

The user will then input an answer as a whole number. If the answer they entered is not a whole

number, tell the user their input is invalid and end the program. If the input is valid, check to see if it is

the correct answer. If correct, congratulate the user by name. If incorrect, output the correct answer.

Tasks

1) The program needs to contain the following

a.

A comment header containing your name and a brief description of the program

b. At least 5 comments besides the comment header explaining what your code does

c.

A string variable that captures the user’s name

d. A way to validate user input to determine if they entered an empty string

i. Warn the user if they enter an empty string

ii. Continue the program after warning the user

e. A prompt for what type of quiz the user wants

f.

Display of a quiz matching the type the user requested

g.

A prompt for an answer in the form of a whole number

i. A message if the user enters an invalid number

1. Do not check the user’s answer if their input is invalid

ii. If input is valid:

1. Check the answer

2. If the answer is correct, congratulate the user by name

3. If incorrect, output the correct answer

h. “Press enter to continue” and Console.ReadLine(); at the end of your code

i. Note: if you write a try-catch statement, these lines will be after your last catch

2) Upload a completed .cs file onto the Assignment 4 submission folder and a word document

containing the following six (6) screenshots:

a.

The warning displayed when the user enters a blank value for the name

b. One test run for each equation with valid input

i. Answer 2 quizzes correctly

ii. Answer 2 quizzes incorrectly

c.

One test run with invalid input

In: Computer Science

Write C functions to do each of the following. Make sure your function has exactly the...

Write C functions to do each of the following. Make sure your function has exactly the same name, parameters, and return type as specified here. Please place all of the functions in a single .c file and write a main() to test them.

  1. int process(const char *input_filename, const char *output_filename) — reads the file named input_filename and processes it, putting results in output_filename. The input file consists of lines of the form "number operation number," for example:

    15 - 4
    3.38 / 2.288
    2 ^ -5
    35.2 + 38

    The possible operations are +, -, *, /, and ^ (power). Your function should calculate the value of each line's expression and save it (one to a line) to the output file. For example, the input file shown above would result in an output file of

    11.000000
    1.477273
    0.031250
    73.200000

    The return value of the function should be the number of calculations that it did (4 for this example file).

    (Hints: fscanf() returns the constant value EOF when the end of file is reached. The pow(x, y) function defined in <math.h> calculates xy; you will need to add -lm to the command line when compiling your code to link the math library.)

In: Computer Science

In C++ You will create 3 files: The .h (specification file), .cpp (implementation file) and main...

In C++

You will create 3 files: The .h (specification file), .cpp (implementation file) and main file. You will practice writing class constants, using data files. You will add methods public and private to your BankAccount class, as well as helper methods in your main class. You will create an arrayy of objects and practice passing objects to and return objects from functions. String functions practice has also been included. You have been given a template in Zylabs to help you with this work. The data file is also uploaded.

  1. Extend the BankAccount class. The member fields of the class are: Account Name, Account Id, Account Number and Account Balance. The field Account Id (is like a private social security number of type int) Convert the variables MIN_BALANCE=9.99, REWARDS_AMOUNT=1000.00, REWARDS_RATE=0.04 to static class constants Here is the UML for the class:

                                                        BankAccount

-string accountName // First and Last name of Account holder

-int accountId // secret social security number

-int accountNumber // integer

-double accountBalance // current balance amount

+ BankAccount()                     //default constructor that sets name to “”, account number to 0 and balance to 0

+BankAccount(string accountName,int id, int accountNumber, double accountBalance)   // regular constructor

+getAccountBalance(): double // returns the balance

+getAccountName: string // returns name

+getAccountNumber: int

+setAccountBalance(double amount) : void

+equals(BankAccount other) : BankAccount // returns BankAccount object **

-getId():int **

+withdraw(double amount) : bool //deducts from balance and returns true if resulting balance is less than minimum balance

+deposit(double amount): void //adds amount to balance. If amount is greater than rewards amount, calls

// addReward method

-addReward(double amount) void // adds rewards rate * amount to balance

+toString(): String   // return the account information as a string with three lines. “Account Name: “ name

                                                                                                                                                   “Account Number:” number

                                                                                                                                                    “Account Balance:” balance

  1. Create a file called BankAccount.cpp which implements the BankAccount class as given in the UML diagram above. The class will have member variables( attributes/data) and instance methods(behaviours/functions that initialize, access and process data)
  2. Create a driver class to do the following:
    1. Read data from the given file BankData.data and create and array of BankAccount Objects

The order in the file is first name, last name, id, account number, balance. Note that account name consists of both first and last name

  1. Print the array (without secret id) similar to Homeowork2 EXCEPT the account balance must show only 2 decimal digits. You will need to do some string processing.
  2. Find the account with largest balance and print it
  3. Find the account with the smallest balance and print it.
  4. Determine if there are duplicate accounts in the array. If there are then set the duplicate account name to XXXX XXXX and rest of the fields to 0. Note it’s hard to “delete” elements from an array. Or add new accounts if there is no room in the array. If duplicate(s) are found, print the array.

Create BankAccount.h.

This is given for BankAccount.cpp:

#include <string>
#include <iostream>
#include "BankAccount.h"

// BankAccount::BankAccount();

BankAccount::BankAccount(std::string accountName, int id, int accountNumber, double accountBalance){
//

}
//getters
  
std::string BankAccount::getAccountName(){
//
}
int BankAccount::getAccountNumber(){
//
}
double BankAccount::getAccountBalance(){
//
}
  
void BankAccount::setAccountBalance(double accountBalance){
//
}
std::string fixPoint(std::string number){
//adjust the two decimal places
}
std::string BankAccount::toString(){

}

bool BankAccount::withdraw(double amount){

//
}
  
void BankAccount::deposit(double amount){
//
}

This is given for main.cpp:

#include <iostream>
#include <fstream>
#include <string>
#include //your header file

using namespace std;
const int SIZE = 8;
void fillArray (ifstream &input,BankAccount accountsArray[]);
int largest(BankAccount accountsArray[]);
int smallest(BankAccount accountsArray[]);
void printArray(BankAccount accountsArray[]);
int main() {

//open file
//fill accounts array
//print array
//find largest
//find smallest
//find duplicates and print if necessary
BankAccount accountsArray[SIZE];
  
fillArray(input,accountsArray);
printArray(accountsArray);
cout<<"Largest Balance: "<<endl;
cout<<accountsArray[largest(accountsArray)].toString()<<endl;
cout<<"Smallest Balance :"<<endl;
cout<<accountsArray[smallest(accountsArray)].toString()<<endl;
}
}
void fillArray (ifstream &input,BankAccount accountsArray[]){

}

int largest(BankAccount accountsArray[]){
//returns index of largest account balance
}
int smallest(BankAccount accountsArray[]){
//returns index of smallest

}
BankAccount removeDuplicate(BankAccount account1, BankAccount account2){

return (account1.equals(account2));

}
void printArray(BankAccount accountsArray[]){
cout<<" FAVORITE BANK - CUSTOMER DETAILS "<<endl;
cout<<" --------------------------------"<<endl;
//print array using to string method

}

file "BankData.dat" contains:

Matilda Patel 453456 1232 -4.00
Fernando Diaz 323468 1234 250.0
Vai vu 432657 1240 987.56
Howard Chen 234129 1236 194.56
Vai vu 432657 1240 -888987.56
Sugata Misra 987654 1238 10004.8
Fernando Diaz 323468 1234 8474.0
Lily Zhaou 786534 1242 001.98

In: Computer Science

Debug the following program.Each line that has a number and line at the end of it...

Debug the following program.Each line that has a number and line at the end of it has an error. The error can be syntax or logic. Correct the error. Rewrite the correct answer in place of the original code :

private void btnCalculate_Click (object sender, System.EventArgs e)

{

intLimit = zero; //

intCounter == 1; // counter need to begin at 1

lstResults.Items.Empty(); // clear ListBox

intLimit = Int32.Parse( txtInput); // retrieve user input from GUI

lstResults.Items.Add( "N/tN^2/tN^3" ); // add header with tabs

calculate and display square and cube of 1 to intLimit

while ( intCounter <= intLimit ) ;

lstbx.Items.Add( intCount = "\t" + Math.Pow( intCount, 2 );

Math.Pow( intCount 3^ );                   

intCount++;                                                        // increment counter

}

In: Computer Science

Convert 0xCD001234 from IEEE-754 hexadecimal to single-precision floating point format. Please show every single detail for...

Convert 0xCD001234 from IEEE-754 hexadecimal to single-precision floating point format.
Please show every single detail for upvote.
Please do not answer otherwise.

In: Computer Science

a style sheet was not new with HTML and even today other languages use a similar...

a style sheet was not new with HTML and even today other languages use a similar approach. JavaFX uses an almost identical style definition as CSS for its style sheets. .NET's Windows Presentation Foundation (WPF) uses an XML like style definition in a language named XAMLAll these different technologies have one thing in common: they separate what is being displayed from how it is being displayed. Why? What is the benefit of doing so, if any? What are the drawbacks, if any? For those of you who may have taken a software architecture/engineering class, the style sheet follows a, currently, very popular architecture, do you know what it is?

120 WORDS MINIMUM

In: Computer Science

Scenario Create an algorithm to solve the maximum subarray problem. Find the non-empty, contiguous subarray of...

Scenario
Create an algorithm to solve the maximum subarray problem. Find the non-empty, contiguous subarray of the input array whose values have the largest sum. You can see an example array with the maximum subarray indicated in the following diagram:

Screen Shot 2019-01-07 at 10.58.06 AM.png
The O(n2) brute force algorithm that tests all combinations for the start and end indices of the subarray is trivial to implement. Try to solve this using the divide and conquer algorithm.

Aim
To design and implement an algorithm to solve the maximum subarray problem with a better runtime than the O(n2) brute force algorithm, using a divide and conquer approach.

Prerequisites
You need to implement the maxSubarray() method of the MaximumSubarray class in the source code, which returns the sum of values for the maximum subarray of the input array. Assume that the sum always fits in an int, and that the size of the input array is at most 100,000.

public class MaximumSubarray {
public Integer maxSubarray(int[] a) {
return null;
}
}
The divide and conquer approach suggests that we divide the subarray into two subarrays of as equal size as possible. After doing so, we know that a maximum subarray must lie in exactly one of following three places:

Entirely in the left subarray
Entirely in the right subarray
Crossing the midpoint
Steps for Completion
The maximum subarray of the arrays on the left and right is given recursively, since those subproblems are smaller instances of the original problem.
Find a maximum subarray that crosses the midpoint.

In: Computer Science

C# What to submit: One zip file named Ass3.zip This zip must contain one VS 2017...

C#

What to submit:

One zip file named Ass3.zip

This zip must contain one VS 2017 solution named Ass3, which contains one C# Windows Forms App project also named Ass3 and the project contains a default form, Form1.cs and Program.cs.

No change should be made in Program.cs, but your Form1 must be designed and implemented to satisfy the following requirements.

**Do not submit only a single file of the solution or project. The whole solution folder of VS 2017 must be zipped and submitted for grading.

Requirements:

  1. Use VS 2017 to create a C# Windows Forms App project whose solution and project are named Ass3. When all requirements below are finished and tested, zip the entire solution as Ass3.zip and upload it for grading.
  2. Use the same Functional Requirement as described in Assignment 2 with the changes below.
  3. Except the Form1 class given by Visual Studio, no other classes need to be defined. That is, the program you did in Assignment 2, including data and methods of the two classes should be "transplanted" in the Form1 class of this Ass3 project.
  4. All input and output should be done within Form1 and visual controls (e.g., textboxes, labels, buttons, etc.) on the form. That is, no console is used--no more command line I/O and no display in the Command Prompt.
  5. Specifically, the two initial integers and each guess should be entered in a corresponding textbox (i.e., three textboxes in total) and the error message "You must enter a number between ... and ...!" will be displayed by a label in red. A second label should be used to display in blue the hint "Higher...", "Lower...", and "You win!". Finally, let the ending message "----End of Game----" be displayed in the form title (in black since title color cannot be changed).
  6. Set the font size of all visual controls to be 18 points.
  7. Add a button showing 'Generate Secrete Number' to create a secrete number every time it is clicked. Because this button can be clicked at any time, there might be an error or hint displayed from the previous play, this button should also erase both labels to empty and reset the form title to 'Form1' when clicked.
  8. To accept a guess, a second button showing 'Guess' should be added on the form. Each time when it is clicked, it first erases the labels from their previous display and then show the error and/or hint message, depending on the guess entered.
  9. Place each visual control in Form1 so they look like the form shown in the demo program attached below.
  10. Same as in Assignment 2, we assume there are always two valid input integers entered to define the range of the random secrete number, and an integer is always entered as the guess value. That means there is no need to validate all three input integers except the guess value could still be out of the range, which explains (in item 5 above) why an error message needs to be displayed.

In: Computer Science

Discuss how a malware can maintain persistence. What do malwares use the SetWindowsHookEx function for?

Discuss how a malware can maintain persistence. What do malwares use the SetWindowsHookEx function for?

In: Computer Science

Do not use awk. Using the fixed length field file called famous.dat, make a one-line Unix...

Do not use awk.

Using the fixed length field file called famous.dat, make a one-line Unix command - using pipe(s) - to display an alphabetical list of the last and first names in upper case of the last 8 people in the file. Hint: Names are in columns 6 through 35. Output is this..

DARWIN         CHARLES      
EINSTEIN       ALBERT       
GALILEO        GALILELI     
GOLDMAN        EMMA         
LOVELACE       ADA          
MANDELA        NELSON       
PARKS          ROSA         
RUSSELL        BERTRAND

Hint:  famous.dat uses space(s) to separate the fields

In: Computer Science

This is a javascript assignment/study guide for an exam. There are 25 steps that are outlined...

This is a javascript assignment/study guide for an exam. There are 25 steps that are outlined by // comments...

<html>
<head>
<style type="text/css">
body {font-family:Comic Sans MS;}
</style>
<script language="javascript">
<!--
function fred()
{
//
// There are 25 questions related to the HTML objects shown on the page
// They are all in the form named "twocities".
//
// Each part of the assignment below instructs you to manipulate or examine
// the value of the HTML elements and place an answer in one
// of twenty-five span blocks that appear on this page.
//
// e.g., for span block named "ans1" you will say:
//
// ans1.innerHTML = "some string";
//
//
// the questions 1 through 15 below use the string value from the textarea named "begins"
// stored in a variable named "beg" like this:

beg=document.twocities.begins.value;
len_beg=beg.length;
//
// *** First remove all the periods, commas and hyphens from the "beg" string before you answer questions 1 through 15
//

//
// ***(1) how many words are the string named "beg"? (words not characters)
// *** show the answer in the span block with id = "ans1"
//

//
// ***(2) store words in the string "beg" in an array.
// *** show the first and last elements of the array in the span block with id="ans2"
//

//
// ***(3) show each word in the array produced in (2) above on one line separated by commas
// *** in the span block with id="ans3"
//

//
// ***(4) create a new string using the value of "beg" where all the characters are capitalized
// *** show the new string in the span block with id="ans4"
//

//
// ***(5) count the number of times the letters "a", "e", "i", "o", "u" appear in the string "beg"
// *** show these 5 counts on one line separated by commas in the span block with id="ans5"
//

//
// ***(6) show the location of each occurence of the character "e" in the string "beg"
// *** on one line separated by commas in the span block with id="ans6"
//

//
// ***(7) show the location where each word begins in the string named "beg"
// *** show the answers on one line separated by commas in the span block with id="ans7"
//


//
// ***(8) place the words in the string "beg" in a table with a one pixel border,
// *** with a gray backgound. Use only ten cells per row. Empty cells should contain
// *** the word "null". Show the table in the span block with id="ans8"
//

//
// ***(9) replace each occurence of the blank character in "beg" with the character "*"
// *** show the result in the span block with id="ans9"
//

//
// ***(10) sort the words in array created in (2) into alphabetical order
// *** show the results in the span block with id="ans10" on a single line
//

//
// ***(11) show the ASCII character number of each character in the string "beg"
// *** separate each value with a comma and place the result on a single line in the span block
// *** with id="ans11"
//

//
// ***(12) count the number of words in the string "beg" that have 2,3,4,5 or 6 characters
// *** show these five counts on a single line separated by commas in the span block with id="ans12"
//

//
// ***(13) create a new string that contains the words in the string "beg" in reverse order
// *** show this new string on a single line in the span block with id="ans13"
//

//
// ***(14) create a new string that contains the characters in the string "beg" in all capital letters
// *** show this new string on a single line in the span block with id="ans14"
//

//
// ***(15) store the number of times the letter "a" appears in the string "beg" in 1st location;
// *** store the number of times the letter "b" appears in the string "beg" in 2nd location;
// *** store the number of times the letter "c" appears in the string "beg" in 3rd location;
// *** store the number of times the letter "d" appears in the string "beg" in 4th location;
// *** etc.
// *** show the 26 counts on one line separated by commas in the span block with id="ans15"
//

//
// ***(16) Examine the radio buttons and produce a list of the three "values" of the radios buttons separated by commas on a single line
// in the span block with id="ans16"

//
// ***(17) Show the value of the radio button which is checked and its elements number separated by a comma on a line by itself
// *** in the span block with id="ans17"
//

//
// *** (18) Show the elements number and value of the six checkboxes in a six-row, two-column table with a 2 pixel border
// *** in the span block with id="ans18"
//

//
// ***(19) Examine the checkboxes and produce a list of the "values" of the checkboxes that are checked. Separated the values by commas on a single line
//

//
// ***(20) Show the values of all the options in the select (drop down menu) named "book3chapters" in an fifteen-column one row table with a 2 pixel border border
// *** in the span block with id="ans20"
//

//
// ***(21) Show the value of the select (drop down menu) named "book3chapters" which is selected and its selectedIndex value separated by a comma on a line by itself
// *** in the span block with id="ans21"
//

//
// *** Retrieve the value of the textarea named "beg" again and store it in a variable named "beg2", DO NOT REMOVE ANY CHARACTERS
// *** You will use this string for questions 22 and 23

//
// *** (22) Show the text phrases that are separated by commas in the string "beg2" . Each phrase should be on a line by itself.
// *** Place the result in the span block with id="ans22"
//

//
// *** (23) Capitalize the first letter of each phrase from #22 bove (phrases are separated by commas) in the original string "beg2".
// *** Place each phrase should be on a line by itself.
// *** Place the result in the span block with id="ans23"
//
//
// *** (24) Make the third radio button ("The Track of The Storm") checked.
// *** Make ALL six of the checkboxes be checked.
// *** Make the select named "book3chapters" (the drop down menu) show "Fifty-Two" as the selection
// *** Place the string "DONE!" in the span block with id="ans24"

//
// *** (25) Place the famous last line of the book (without quotes) in the span block with id="ans25"
//


}
-->
</script>
</head>
<body>
<CENTER>
<TABLE border="2" width="100%">
<TR><TD width="120" valign="middle" align="center" bgColor="#bbbbbb"><center><IMG align="top" alt="capt webb" border=2 src="captsm.gif"><BR><span STYLE="font-size:8px">Capt. Horatio T.P. Webb</span></center></TD>
<TD valign="middle" bgColor="#bbbbbb" colSpan="2" align="center"><center><B>ASSIGNMENT #1 Javascript<br>MIS 3371 Transaction Processing I<BR>Parks -- Spring 2016</B><BR><span STYLE="font-size:10px">Version 1 -- Last Updated 9:00 AM 1/12/2016</span></center></TD></TR></table></center>
The text used in this assignment is from Charles Dicken's novel "A Tale of Two Cities" written in 1859<br>Read it at the free online book site:<br>Project Gutenberg: <a href="http://www.gutenberg.org/cache/epub/98/pg98.txt">http://www.gutenberg.org/cache/epub/98/pg98.txt</a>
<form name="twocities">
<p>All the HTML elements below are in a form named "twocities". View "Source" to see the 25 questions.
<p>
<table border="1" cellspacing="0" width="100%">
<tr><td valign="top">1. The textarea below is named <b>begins</b><br>It contains the opening text of the book (form elements number 0)
<br><textarea style="margin:6px;" name="begins" rows="10" cols="80">It was the best of times, it was the worst of times,
it was the age of wisdom, it was the age of foolishness,
it was the epoch of belief, it was the epoch of incredulity,
it was the season of Light, it was the season of Darkness,
it was the spring of hope, it was the winter of despair,
we had everything before us, we had nothing before us,
we were all going direct to Heaven, we were all going direct the other way --
in short, the period was so far like the present period,
that some of its noisiest authorities insisted on its being received,
for good or for evil, in the superlative degree of comparison only.</textarea></td>
<td valign="top">2. The novel "A Tale of Two Cities" is divided into 3 books named below.<br>
There are 3 radio buttons below are named: <b>books</b><br>(form elements 1 &rarr; 3).
<br>Their values are: "1", "2" and "3"
<p><input type="radio" name="books" value="1" checked> Recalled To Life&nbsp;
<br><input type="radio" name="books" value="2"> The Golden Thread&nbsp;
<br><input type="radio" name="books" value="3"> The Track of The Storm&nbsp;
</td>
</tr>
<tr><td valign="top">3. The titles of the six chapters of the first book are shown below.
<br>The 6 checkboxes below are named: <b>c1</b> &rarr; <b>c6</b> (form elements 4 &rarr; 9). <br>
Their values are the same as the text that appear to the right of each checkbox.
<br>&nbsp;<input type="checkbox" name="c1" value="The Period">The Period
<br>&nbsp;<input type="checkbox" name="c2" value="The Mail" checked>The Mail
<br>&nbsp;<input type="checkbox" name="c3" value="The Night Shadows">The Night Shadows
<br>&nbsp;<input type="checkbox" name="c4" value="The Prepartion" checked>The Preparation
<br>&nbsp;<input type="checkbox" name="c5" value="The Wine Shop">The Wine-shop
<br>&nbsp;<input type="checkbox" name="c6" value="The Shoemaker" checked>The Shoemaker</b>
</td><td valign="top">4. The select (drop down menu) below is named <b>book3chapters</b>
<br>(form elements number 10).
<br>The fifteen options are the titles of the fifteen chapters in Book 3.
<br>The values of the 15 options are the same as the option text shown on the select below:
<p>
<select name="book3chapters">
<option value="In Secret">In Secret
<option value="The Grindstone">The Grindstone
<option value="The Shadow">The Shadow
<option value="Calm in Storm">Calm in Storm
<option value="The Wood-sawyer">The Wood-sawyer
<option value="Triumph">Triumph
<option value="A Knock at the Door">A Knock at the Door
<option value="A Hand at Cards">A Hand at Cards
<option value="The Game Made">The Game Made
<option value="The Substance of the Shadow">The Substance of the Shadow
<option value="Dusk">Dusk
<option value="Darkness">Darkness
<option value="Fifty-two">Fifty-two
<option value="The Knitting Done">The Knitting Done
<option value="The Footsteps Die Out For Ever">The Footsteps Die Out For Ever
</select></b></td></tr></table>
</form>
<p>
<ol>
<li><span id="ans1">Contents of the span block with id="LuL"</span>
<li><span id="ans2">Contents of the span block with id="ans2"</span>
<li><span id="ans3">Contents of the span block with id="ans3"</span>
<li><span id="ans4">Contents of the span block with id="ans4"</span>
<li><span id="ans5">Contents of the span block with id="ans5"</span>
<li><span id="ans6">Contents of the span block with id="ans6"</span>
<li><span id="ans7">Contents of the span block with id="ans7"</span>
<li><span id="ans8">Contents of the span block with id="ans8"</span>
<li><span id="ans9">Contents of the span block with id="ans9"</span>
<li><span id="ans10">Contents of the span block with id="ans10"</span>
<li><span id="ans11">Contents of the span block with id="ans11"</span>
<li><span id="ans12">Contents of the span block with id="ans12"</span>
<li><span id="ans13">Contents of the span block with id="ans13"</span>
<li><span id="ans14">Contents of the span block with id="ans14"</span>
<li><span id="ans15">Contents of the span block with id="ans15"</span>
<li><span id="ans16">Contents of the span block with id="ans16"</span>
<li><span id="ans17">Contents of the span block with id="ans17"</span>
<li><span id="ans18">Contents of the span block with id="ans18"</span>
<li><span id="ans19">Contents of the span block with id="ans19"</span>
<li><span id="ans20">Contents of the span block with id="ans20"</span>
<li><span id="ans21">Contents of the span block with id="ans21"</span>
<li><span id="ans22">Contents of the span block with id="ans22"</span>
<li><span id="ans23">Contents of the span block with id="ans23"</span>
<li><span id="ans24">Contents of the span block with id="ans24"</span>
<li><span id="ans25">Contents of the span block with id="ans25"</span>
</ol>
<br><input type="button" value="this button executes the function fred()" onClick="fred()">
</body>
</HTML>

In: Computer Science

Explain how process replacement works. What functions does it use?

Explain how process replacement works. What functions does it use?

In: Computer Science

Increasingly patients expect full access to their EMRs and EHRs. What limitations, if any, would be...

Increasingly patients expect full access to their EMRs and EHRs. What limitations, if any, would be in the best interest of patients? For example, should healthcare providers have access to new test results for 3 full business days before these are posted for patient viewing?

I am needing to find sources to answer this question. They need to be peer-reviewed nursing journals from the year 2013+. I am having trouble finding the correct resources in order to find the peer-reviewed nursing journals. I utilized my textbook and the databases at my college and am still at a loss. If you find any good sources that answer this question will you please copy and paste the links for me please? Or if you have any advice for me? Thank you!

In: Computer Science