Questions Uploads

java programming

I am currently going through a java programming class at Southern New Hampshire University. I really need some assistance with this lab. It is in Zybooks chapter 5 lab 5.6.1.

Instructions are as follows:

(1) Prompt the user for a string that contains two strings separated by a comma. (1 pt)

Example:

Enter input string: Jill, Allen

(2) Report an error if the input string does not contain a comma. Continue to prompt until a valid string is entered. Note: If the input contains a comma, then assume that the input also contains two strings. (2 pts)

Example:

Enter input string: Jill Allen

Error: No comma in string

Enter input string: Jill, Allen

(3) Extract the two words from the input string and remove any spaces. Store the strings in two separate variables and output the strings. (2 pts)

Example:

Enter input string: Jill, Allen

First word: Jill

Second word: Allen

(4) Using a loop, extend the program to handle multiple lines of input. Continue until the user enters q to quit. (2 pts)

Example:

Enter input string: Jill, Allen

First word: Jill

Second word: Allen

Enter input string: Golden , Monkey

First word: Golden

Second word: Monkey

Enter input string: Washington,DC

First word: Washington

Second word: DC

Enter input string: q

This is what I have come up with so far. I am unsure of where to start loop and extracting words from userInput.

import java.util.Scanner;

public class ParseStrings {

  public static void main(String[] args) {

   Scanner scnr = new Scanner(System.in);

   String userInput = “”;

   String word1 = “”;

   String word2 = “”;

   char q = ‘q’;

    System.out.println(“Enter input string: “);

    userInput =scnr.nextLine();

   // while (!userInput.equals(“q”)) {         //exit upon the press of q

   if (userInput.contains(“,”)) {            //error report for no comma

     System.out.print(userInput);

   }

   else {

     System.out.println(“Error: no comma in string.”);

      }

      scnr.close();

   // }

Top Answer

 
Looking for a Similar Assignment? Order now and Get 10% Discount! Use Coupon Code "Newclient"

Discussion Guidelines and Rubric Overview

IT 100 Discussion Guidelines and Rubric Overview: Your active participation in the discussion forums is essential to your overall success this term. Discussion questions are designed to help you make meaningful connections between the course content and the larger concepts and goals of the course. These discussions offer you the opportunity to express your own thoughts, ask questions for clarification, and gain insight from your classmates’ responses and instructor’s guidance. Requirements: For each discussion assignment, you are required to post one initial post and to follow up with at least two response posts. For your initial post (1), you must do the following:  Compose a post of 1 to 2 paragraphs.  In Module One, complete the initial post by Thursday at 11:59 p.m. Eastern Time.  In Modules Two through Eight, complete the initial post by Thursday at 11:59 p.m. of your local time zone.  Take into consideration material such as course content, TestOut assignments, and other discussion boards from the current module and previous modules, when appropriate. For your response posts (2), you must do the following:  Reply to at least two different classmates outside of your own initial post thread.  In Module One, complete the two response posts by Sunday at 11:59 p.m. Eastern Time.  In Modules Two through Eight, complete the two response posts by Sunday at 11:59 p.m. of your local time zone.  Demonstrate more depth and thought than simply stating, “I agree” or “You are wrong.” Guidance is provided for you in each discussion prompt. Rubric Instructor Feedback: This activity uses an integrated rubric in Blackboard. Students can view instructor feedback in the Grade Center. For more information, review these instructions. Critical Elements Exemplary Proficient Needs Improvement Not Evident Value Comprehension Develops an initial post with an organized, clear point of view or idea using rich and significant detail (100%) Develops an initial post with a point of view or idea using adequate organization and detail (85%) Develops an initial post with a point of view or idea but with some gaps in organization and detail (55%) Does not develop an initial post with an organized point of view or idea (0%) 40 Timeliness Submits initial post on time (100%) Submits initial post one day late (55%) Submits initial post two or more days late (0%) 10 Engagement Provides relevant and meaningful response posts with clarifying explanation and detail (100%) Provides relevant response posts with some explanation and detail (85%) Provides somewhat relevant response posts with some explanation and detail (55%) Provides response posts that are generic with little explanation or detail (0%) 30 Writing (Mechanics) Writes posts that are easily understood, clear, and concise (100%) Writes posts that are easily understood (85%) Writes posts that are understandable (55%) Writes posts that others are not able to understand (0%) 20 Total 100%

 
Looking for a Similar Assignment? Order now and Get 10% Discount! Use Coupon Code "Newclient"

Calculate the subnet ID, given the following IPv6 address and prefix length: 2001:0DB8:DCBA:1122:7351:9442:FEDC:0312/64 Calculate the subnet ID, given the following IPv6 address and prefix length: 2001:0DB8:DCCB:1234:1357:9246:FEDC:0341/64

Calculate the subnet ID, given the following IPv6 address and prefix length: 2001:0DB8:DCBA:1122:7351:9442:FEDC:0312/64

 Calculate the subnet ID, given the following IPv6 address and prefix length: 2001:0DB8:DCCB:1234:1357:9246:FEDC:0341/64

 
Looking for a Similar Assignment? Order now and Get 10% Discount! Use Coupon Code "Newclient"

security of the network

Why does the use of passwords put the overall security of the network in jeopardy? First, explain the techniques and tactics that hackers commonly utilize in order to compromise passwords. Next, navigate to the following site: How Big Is Your Haystack? Once in the site, experiment with passwords of varying lengths and character types. Then, discuss your findings in the discussion forum. Be sure to discuss the impact that changing the structure of the password had on overall password security. Finally, in responding to your peers’ posts, discuss whether additional measures could have been taken in order to reduce the threat potential.

 
Looking for a Similar Assignment? Order now and Get 10% Discount! Use Coupon Code "Newclient"