Course Solutions Uncategorized (Solved) : Exercise 1 Examine Shoppingcartjava Perform Following Use Indexof Method Get Index Space C Q36545258 . . . .

(Solved) : Exercise 1 Examine Shoppingcartjava Perform Following Use Indexof Method Get Index Space C Q36545258 . . . .

 

Exercise 1

• Examine ShoppingCart.java.

– Perform the following:

– Use the indexOf method to get the index for the spacecharacter (” “) within custName. Assign it to spaceIdx.

– Use the substring method and spaceIdx to get the first nameportion of custName. Assign it to firstName and printfirstName.

public class ShoppingCart {

    public static void main (String[] args){

        String custName =”Steve Smith”;

        String firstName;

        int spaceIdx;

       

        // Get the index ofthe space character (” “) in custName.

        // Use the substringmethod parse out the first name and print it.

    }

   

}

Exercise 2

Examine NameMaker.java.

• Perform the following:

– Declare String variables: firstName, middleName, lastName, andfullName

– Prompt users

OR

PayPal Gateway not configured

OR

PayPal Gateway not configured

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

(Solved) : 1 Describe Brief Article Functions Software Development Process Software Quality Assurance Q26184544 . . . .(Solved) : 1 Describe Brief Article Functions Software Development Process Software Quality Assurance Q26184544 . . . .

<p><strong><em>1. Describe in a brief article the functions ofsoftware development process software quality assurance, softwareproject management and software configuration management. Discusshow these work together during the software development life cycle.Discuss