Search:

Type: Posts; User: Mehwish-S

Search: Search took 0.51 seconds.

  1. Replies
    1
    Views
    280

    Code for EvenCount

    package mocktest;

    public class EvenCount {

    public String count(String x) {

    if (x < 10 && x % 2 == 0)
    return 1;
    else if (x < 10 && % 2 !0)
    return 0;
  2. Replies
    8
    Views
    367

    Code for EvenCount

    Create a class called EvenCount that contains a method called count that takes an integer as an argument and returns an integer (this method should not be declared static). The count method should...
  3. Replies
    4
    Views
    301

    Reverse a String

    package mocktest;

    public class StringFlip {

    public String reverse(String x) {

    String result = "";

    for (int i = 0; i < lenght(); i++) {
  4. Replies
    1
    Views
    1,221

    Validating UK postcodes

    In general, the UK postcode format is one of "A9 9AA", "A99 9AA", "AA9 9AA", "AA99 9AA", "A9A 9AA" or "AA9A 9AA", where A is an alphabetic character and 9 is a numeric character.
    Write a Java...
  5. Replies
    2
    Views
    464

    Write a Java program that reads file

    Write a Java program that reads the file "X", and prints to the console the file update time, the list of marks for a given UB number and the corresponding “marks gained” value.
    So far I have got...
Results 1 to 5 of 5