Posts

Game playing with number with computer in java

  package com.company ; import java.util.Scanner ; import java.util.Random ; class Game { int number ; int Inputnumber ; int NumberofGuesses = 0 ; public int getNumberofGuesses () { return NumberofGuesses ; } public void setNumberofGuesses ( int numberofGuesses ) { this . NumberofGuesses = numberofGuesses ; } Game () { Random rn = new Random (); this . number = rn . nextInt ( 100 ); } void takeUserInput () { System . out . println ( "enter your choice" ); Scanner sc = new Scanner ( System . in ); Inputnumber = sc . nextInt (); } boolean isCorrectNumber () { NumberofGuesses ++; if ( Inputnumber == number ) { System . out . format ( "yes you guessed it right, it was %d \n you get it in %d attempts " , number , NumberofGuesses ); return true ; } else if ( Inputnumber < number ) { System . out . p...

tictaktoe game

  #include <bits/stdc++.h> using   namespace   std ; int   main (){      int   t ;  cin >> t ;      while ( t --){          char   a [ 3 ][ 3 ];  int   countx = 0 ,  counto = 0 ,  winx = 0 ,  wino = 0 ,  count_ = 0 ;          for ( int   i = 0 ;  i < 3 ;  i ++){              for ( int   j = 0 ;  j < 3 ;  j ++){                  cin >> a [ i ][ j ];                  if ( a [ i ][ j ]== 'X' )  countx ++;                  else   if ( a [ i ][ j ]== 'O...

Game: Sciessor, Paper and Stone game in jave and it s source code is here

  package com.company ; import java.util.Scanner ; import java.util.Random ; public class rock_paper_scissors_game { public static void main (String[] args) { System. out .println( "before starting the game you should know this convention" ) ; System. out .println( "Scissor=0" ) ; System. out .println( "Paper=1" ) ; System. out .println( "Rock=2" ) ; short draw= 0 ; short yourCounter= 0 ; short compCounter= 0 ; for ( int i= 0 ; i< 3 ; i++) { Random rn = new Random() ; Scanner sc = new Scanner(System. in ) ; System. out .println( "ENTER YOUR CHOICE" ) ; byte choice = sc.nextByte() ; System. out .println( "CHOICE ENTERED BY COMPUTER" ) ; byte compRandom = ( byte ) rn.nextInt( 3 ) ; switch (choice) { case 0 : if (compRandom == 0 ) { ...

oops in c++ class

  #include   < iostream > #include   < sstream > using   namespace   std ; /* Enter code for class Student here. Read statement for specification. */ class   Student {      private :      int   age ,   standard ;      string   first_name ,   last_name ;           public :     void   set_age ( int   a ){ age = a ;}     void   set_standard ( int   s ){ standard = s ;}     void   set_first_name ( string   fname ){ first_name = fname ;}     void   set_last_name ( string   lname ){ last_name = lname ;}         int   get_age (){ return   age ;}     int   get_standard (){ return   standard ;}     string   get_firs...

Publish your website for free | fastest and quickest way

Image

css in phone

  /* navigation */ #navbar {      flex-direction :  column ; } #navbar   ul   li   a {      font-size :  1rem ;      padding :  0px   7px ; } /* Home section */ #home {    height :  370px ;    padding :  3px   55px ; } #home   p {      font-size :  13px ; } #home::before {    height :  280px ; } /* services section */ #services { flex-direction :  column ; } #services   .box { padding :  14px ; margin :  2px   0px ; margin-bottom :  20px ; } /* clientsection */ #clients {      overflow :  hidden ; } #clients   img {      width :  66px ;      padding :  6px ; } /* contact Us section */ /* Footer */ /* Utility class...

CSS IN website

  /* css reset */ * {      margin :  0px ;      padding :  0px ; } html {      scroll-behavior :  smooth ; } /* CSS Variables */ :root {      --navbar-height :  59px ; } /* Navigaqtion Bar */ #navbar {      display :  flex ;      align-items :  center ;      position :  sticky ; } /* Navigation Bar: Logo and Image */ #logo { margin :  -3px   -5px ; } #logo   img {      margin :  8px   30px ;      height :  40px ; } #navbar {      position :  absolute ;      top :  0px ; } /* Navigation Bar: list Styling */   #navbar   ul {      display :  flex ;   ...