- Dapatkan link
- X
- Aplikasi Lainnya
html:
<html>
<head>
<title> PaceKomputer145 </title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body background="coding.png">
<div class="wrap">
<div class="header">
<h1>PaceKomputer145</h1>
<p></p>
</div>
<div class="menu">
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">LOGIN</a></li>
<li><a href="#">USERNAME</a></li>
<li><a href="#">DO YOU HAVE ACCOUNT</a></li>
<li><a href="#">CLICK IN HERE</a></li>
</ul>
</div>
<div class="badan">
<div class="sidebar">
Materi
<ul>
<li><a href="#">bab 1</a></li>
<li><a href="#">bab 2</a></li>
<li><a href="#">bab 3</a></li>
<li><a href="#">bab 4</a></li>
</ul>
</div>
<div class="content">
content
</div>
</div>
<div class="clear"></div>
<div class="footer"></div
footer
</div>
</div>
</body>
</html>
css
img {
width: 250px;
height: 100px;
}
.wrap{
background : white;
width: 900px;
margin: 10px auto;
}
/*bagian header*/
.wrap .header{
background: coding.png;
/*height: 50px;*/
padding: 2px 300px;
}
/*akhir header*/
/*bagian menu*/
.wrap .menu{
background: black;
}
.wrap .menu ul{
padding: 10;
margin: 0;
background: red;
overflow: hidden;
}
.wrap .menu ul li{
float: left;
list-style-type: none;
padding: 30px;
}
/*akhir menu*/
.clear{
clear: both;
}
.badan{
height: 500px;
}
/*bagian sidebar*/
.wrap .badan .sidebar{
background: orange;
float: left;
width: 100%;
height: 100%;
}
/*akhir sidebar*/
.wrap .badan .content{
background: red;
float: left;
height: 100%;
width: 100%;
}
.wrap .footer{
width: 100%;
padding: 10px;
}
System.out.println();
int numChars = 0;
char x;
Scanner bacaChar = new Scanner(System.in);
System.out.print("Ketikkan nama dan ekstensi file: ");
namafile = bacaChar.nextLine();
fileName = "src/main/java/BacaFile/" + namafile ;
System.out.print("Ketikkan huruf yang ingin di cari: ");
x = bacaChar.next().charAt(0);
Scanner fileSaya = null;
try{
Scanner file = new Scanner(new File(fileName));
fileSaya = file;
} catch (FileNotFoundException e){
System.out.println("Tidak ada filenya");
}
while(fileSaya.hasNextLine()){
String panjangTeks = fileSaya.nextLine();
int size = panjangTeks.length();
for (int i=0; i<size; i++){
char kar = Character.toLowerCase(panjangTeks.charAt(i));
if (kar == x){
numChars++;
}
}
}
System.out.println();
System.out.println("Hasil:");
System.out.println("Jumlah Huruf "+x+" : " + numChars);
- Dapatkan link
- X
- Aplikasi Lainnya
Komentar
Posting Komentar