Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,152,962 members, 7,817,835 topics. Date: Saturday, 04 May 2024 at 08:43 PM

Someone Help On A Very Urgent Question Pls Guys - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Someone Help On A Very Urgent Question Pls Guys (876 Views)

Java Proramers:java Assignment: Can Someone Help Provide A Solution To This / Can Someone Help Out On How To Add A Database To My Windows Forms App / Runnable Java Atm Source Code Anybody,pls For Project, Very Urgent (2) (3) (4)

(1) (Reply) (Go Down)

Someone Help On A Very Urgent Question Pls Guys by dsypha(m): 11:23pm On Sep 17, 2013
pls guys help, I was jus goin tru some beginner exercises in java. came accross dis question. I've tried many times but can't get it... pls som1 help me wit a soln or jus an idea pls oo! I tak God beg una!


Write an application that inputs a line of text and a search character and
use string method indexOf to determine the number of occurences of the character in the text. Uppercase and lowercase should be counted together..



pls som1 shud help oo
Re: Someone Help On A Very Urgent Question Pls Guys by nollyj: 11:31pm On Sep 17, 2013
I think it will be nice for you to show what you have done and other people will direct you on how best to solve the problem rather wait for a complete solution
Re: Someone Help On A Very Urgent Question Pls Guys by dsypha(m): 11:53pm On Sep 17, 2013
nollyj: I think it will be nice for you to show what you have done and other people will direct you on how best to solve the problem rather wait for a complete solution

bro am typin from fone, nt pc... anyways I'll summarize.. I used a diff method to get d work done actually bt d book specifies I use string's indexOf method .. Wat I acutually did was split d text to be searched tru... den loop tru d arrays of d text pieces, and incremented a variable everytim I came acros d search char. bt I want to see hw its done wit indexOf. and again d method I used was case sensitiv, if I searched for o, all ocurence of O will nt b considered which again, is against d question
Re: Someone Help On A Very Urgent Question Pls Guys by dsypha(m): 6:54am On Sep 21, 2013
Naija programmers busy ehn... #Smh!
Re: Someone Help On A Very Urgent Question Pls Guys by mashnino(m): 11:27am On Sep 21, 2013
Sorry I am on phone... I woulda tried it for you... But dey ve alredy Givin u ansa na... Use d indexOf with an if.... Else statement... Den increment d variable... Wen i get on system I will try it for you...
Re: Someone Help On A Very Urgent Question Pls Guys by ooman(m): 2:54pm On Sep 21, 2013
class Searchchar{


static public void main (String.... args){
java.util.Scanner input=new java.util.Scanner(System.in);

String user=input.nextLine();

if (user.indexOf("a"wink || user.indexOf("A"wink;
int count= count + 1;

System.out.print(count);


//am on mobile... not compiled

(1) (Reply)

Whr Can I Learn Networking Cisco And Ccna Here In Lagos At Ajah? / Zerodium Offers $3,000,000 Bounty For A Successful Jailbreak Of IOS 9 / Content Developers Into Media Files (CRBT) #urgent

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 12
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.