Please code in Java Programming Language.
Each Class must be seperated clearly
Class IString:
************************
************************
Main class:
************************
********************
MyString class:
************************
public class MyString implements IString{
@Override public int sum(String string) { ................... }
@Override public String getCode(String string) {
............................................ }
}********************
Question 4: (2 Point) You are given an interface named IString (DO NOT EDIT THIS ONE). Design a class MyString which will implement the interface IString. <<interface>> IString +sum(re:String):int +getCode(re:String):String MyString 1. int sum(rc:String) - used to calculate the summation of all even digits in a given string "rc". 2. String getCode(rc:String) - this function return code of RC as the rule: o Code of RC = all digit characters and uppercase letters in the same order as original given string "rc". No of test case The program output might look something like: Correct output
Question paper (build 07.05.20.19) Zoom E 2. Jening Betoootprenderings RTUNCIONtetan coat oF THE ĐỰ ĐHE THIC o Code of RC = all digit characters and uppercase letters in the same order as original given string "re". The program output might look something like: Correct output No of test case 6 of 6 1 2 Paper No: 6 1. TC 1 test sum() 2. TC= 2 test getCode() Enter TC: 1 Enter a value in a string: 123@123a2 OUTPUT: 6 1. TC 2. TC Enter TC: 2 Enter a value of rc: 1A2haiBc91 OUTPUT: 1A2B91 + 100% 1 test sum() 2 test getCode() Type here to search E 2 ENG I Cose 4:20 PM 8/30/2019 P
Please code in Java Programming Language. Each Class must be seperated clearly Class IString: ************************ *
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am