Stars

  • Uploaded by: Jennifer Sun
  • 0
  • 0
  • October 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Stars as PDF for free.

More details

  • Words: 98
  • Pages: 1
/* * * Author: J Sun * 10/7/07 */ import java.util.Scanner; public class StarMethod { public static void main(String[] args) { Scanner scan = new Scanner (System.in); String user = ""; int indexOf = 0; of stars String yesNo = ""; System.out.println("Enter something."); user = scan.nextLine();

//imports scanner //userinput //the number for the index //true or false value //asks user for input //scans info

if (user.length()<0||user.indexOf('*')<0) //if a string does not have any info and no star yesNo = "false"; //returns false else if (user.length()>0&&user.indexOf('*')>0)//if it does yesNo = "true"; //returns true System.out.println(yesNo);

} //psvm } //pcSM

//output.

Related Documents

Stars
May 2020 33
Stars
October 2019 29
Stars
October 2019 36
Stars
August 2019 39
Stars
December 2019 34
Stars
November 2019 33

More Documents from ""

10212007mordredoutline
October 2019 15
Dqweekeight
October 2019 11
Dqweekeleven
October 2019 13
Dqweekseven00
October 2019 22
Dqweektwelve
October 2019 14