0% found this document useful (0 votes)
69 views3 pages

King Abdulaziz University: Faculty of Computing and Information Technology

This document outlines Programming Assignment #3 for CPCS 202, which is due on February 7, 2023. It includes 4 problems worth a total of 9% of the course grade. Students must submit solutions to the problems via Beecrowd and Blackboard by the deadline. The problems require using methods, and specific methods are outlined that must be used for each problem. Details are provided on method names, parameters, return types, and how they should be called.

Uploaded by

The Best Abood
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
69 views3 pages

King Abdulaziz University: Faculty of Computing and Information Technology

This document outlines Programming Assignment #3 for CPCS 202, which is due on February 7, 2023. It includes 4 problems worth a total of 9% of the course grade. Students must submit solutions to the problems via Beecrowd and Blackboard by the deadline. The problems require using methods, and specific methods are outlined that must be used for each problem. Details are provided on method names, parameters, return types, and how they should be called.

Uploaded by

The Best Abood
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Programming 2 (CPCS 202), 2nd Semester 1444

King Abdulaziz University


Faculty of Computing and Information Technology
Computer Science Department

Programming II (CPCS202) – Assignment #3


Assigned: 29th January, 2023 (Sunday)
Due: 11:59 PM on 7th February, 2023 (Tuesday)

Objective

The purpose of this assignment is to practice using methods in Java

Instructions:
• This program is worth 9% of your final grade
• The deadline for submission for this assignment is by 11:59 PM on Tuesday, 7th
February, 2023, on Blackboard
• Late Submission: late submissions are allowed but with a penalty. If you submit after the
deadline but before 11:59 PM on Wednesday, 8th February, 2023, you will receive a 25%
deduction. No submissions are accepted after this date/time
• This is an individual assignment, and you must solve it by yourself. Any form of cheating will
result in you receiving 0% in the assignment.
• Please read the course and department policies on the course syllabus regarding plagiarism
and cheating.
• This assignment must be submitted in the “CPCS 202 – Programming I” discipline on
Beecrowd and uploaded to Blackboard.

Description

In this assignment, you are required to solve four problems given in Table 1 using the methods
described below. Solutions to the four problems should be submitted in the Java programming
language to Beecrowd and uploaded to Blackboard before the specified deadlines to be
considered for the award of marks. The solutions should include both the declaration and call to
the specified methods. Solutions which do not contain the method declaration or a call to the
specified method will be awarded zero for that problem even if the solution is correct and
accepted by Beecrowd.

1
Programming 2 (CPCS 202), 2nd Semester 1444

Table 1 : List of problems for Assignment #3


Problem name and link Marks
1 Middle Nephew 2
https://www.beecrowd.com.br/judge/en/problems/view/3301

2 Playing Darts by Distance 2
https://www.beecrowd.com.br/judge/en/problems/view/3037

3 Vehicular Restriction 5
https://www.beecrowd.com.br/judge/en/problems/view/2712

Total 9

Hint : Since Scanner may have to be used in multiple methods, declare it once at the beginning as follows

import java.util.Scanner;
public class Main {

static Scanner in = new Scanner(System.in);

// Rest of your code below

The method below must be used in Problem #1

Name of Method : printMiddle()


Input parameters : Ages of the three nephews as three separate integers
Return : Nothing

The method should print the name of the middle nephew in lowercase as specified
in the problem statement. It should be called from the main() method.

The method below must be used in Problem #2

Name of Method : getScore()


Input parameters : none
Return : int

Should be called from the main() method for each user. This method should read
three lines corresponding to the pitch of one user and then calculate and return the
score for that user.

The following four methods must be used in Problem #3

Name of Method : isUpperCase()


Input parameters : one character
Return : true if the character is upper case or false otherwise

Should be called from the isValid() method

2
Programming 2 (CPCS 202), 2nd Semester 1444

Name of Method : isDigit()


Input parameters : one character
Return : true if the character represents a digit or false otherwise

Should be called from the isValid() method

Name of Method : isValid()


Input parameters : one String
Return : true if the String represents a valid car plate in the correct format

Should be called from the main method to check if the given number plate is in the
correct format.

Name of Method : printDay()


Input parameters : character (representing the last digit of the valid car plate number)
Return : display the day corresponding to the last digit

Should be called from the main method only if the given number plate is in the
correct format.

The main method should call the isValid() method to check the validity of the car number plate.
If it is not valid it should display “FAILURE”. If the plate is valid, the main() method should call
the printDay() method to display the corresponding day.

Deliverables

You are required to upload your three solutions in the Java programming language to Beecrowd
and on Blackboard as part of this assignment. The three files should be named as
Problem_1.java, Problem_2.java and Problem_3.java and should be uploaded separately (not
zipped).

Each of your Java files should have the following header (comments)

/* Course : CPCS 202


Name :
ID :
Section :
Name of lab instructor :
Problem number :
Assignment number : 3
Link to your beecrowd :
*/

You might also like