There are 2 projects, 10 points each. Put both projects in one folder, zip it an
ID: 3754826 • Letter: T
Question
There are 2 projects, 10 points each. Put both projects in one folder, zip it and upload it.
Project1. The program will read arithmetic expressions from an input file, one per line of input, determining if the parentheses are matched (an even number of left and right), or if there are extra left parentheses, or extra right parentheses. DO NOT COUNT the parentheses. Use a stack to determine this. Input file is called H6Input1.txt Use a Stack of doubly linked NODES for Project1. NOT the java built in Stack class.
Project2. The program will output the binary equivalent of a positive decimal integer. Input file is called H6Input2.txt and consists of several integers, not necessarily one per line. Use the java built in Stack for Project2
RUBRIC:
This criterion is linked to a Learning OutcomeProject 1. comments
Full Marks
No Marks
1.0 pts
This criterion is linked to a Learning OutcomeProject 1..determine if character is a parenthesis
Full Marks
No Marks
2.0 pts
This criterion is linked to a Learning OutcomeProject 1..correctly use push and pop (do not pop an empty stack)
Full Marks
No Marks
3.0 pts
This criterion is linked to a Learning OutcomeProject 1.. correct output
Full Marks
No Marks
2.0 pts
This criterion is linked to a Learning OutcomeProject 1.. correctly pick up input
Full Marks
No Marks
2.0 pts
This criterion is linked to a Learning OutcomeProject 2. comments
Full Marks
No Marks
1.0 pts
This criterion is linked to a Learning OutcomeProject2. put remainders on stack
Full Marks
No Marks
5.0 pts
This criterion is linked to a Learning OutcomeProject2. correct output
Full Marks
No Marks
4.0 pts
Total Points: 20.0
This criterion is linked to a Learning OutcomeProject 1. comments
1.0 ptsFull Marks
0.0 ptsNo Marks
1.0 pts
This criterion is linked to a Learning OutcomeProject 1..determine if character is a parenthesis
2.0 ptsFull Marks
0.0 ptsNo Marks
2.0 pts
This criterion is linked to a Learning OutcomeProject 1..correctly use push and pop (do not pop an empty stack)
3.0 ptsFull Marks
0.0 ptsNo Marks
3.0 pts
This criterion is linked to a Learning OutcomeProject 1.. correct output
2.0 ptsFull Marks
0.0 ptsNo Marks
2.0 pts
This criterion is linked to a Learning OutcomeProject 1.. correctly pick up input
2.0 ptsFull Marks
0.0 ptsNo Marks
2.0 pts
This criterion is linked to a Learning OutcomeProject 2. comments
1.0 ptsFull Marks
0.0 ptsNo Marks
1.0 pts
This criterion is linked to a Learning OutcomeProject2. put remainders on stack
5.0 ptsFull Marks
0.0 ptsNo Marks
5.0 pts
This criterion is linked to a Learning OutcomeProject2. correct output
4.0 ptsFull Marks
0.0 ptsNo Marks
4.0 pts
Total Points: 20.0
Explanation / Answer
import java.util.*;
class BinaryString {
BinaryString(String string){
for( byte b : string.getBytes() ){
System.out.print(Integer.toBinaryString(b) + " ");
}
System.out.println();
}
BinaryString(Integer integer){
System.out.println(Integer.toBinaryString(integer));
}
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
new BinaryString(scanner.next());
scanner.close();
}
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.