Hi Everyone, I am trying to get the program below to work correctly. The line below is where I'm having trouble. (line 33 in PrefixCalc.java) calc = new ExpressionTree(new Scanner(console.nextLine())); When I run the program and enter "4 + 8", the scanner only picks up "4". Apparently this program was developed using the Scanner from Java 5. How do I get the entire line into a Scanner object? *** I found this program online at http://penguin.ewu.edu/cscd300/Topic/ExpressionTree/ExpressionTree.pdf. This is not my program. I am just learning from it. *** /** * Prefix calculator: generate the expression tree, then display it * …

Member Avatar
Member Avatar
+0 forum 4

I need to copy a certain line from a text document, this I have done by using a "key-word" in the document. My problem now is that I also want to copy the entire line below this specific line. Help is much appreciated as I am new with programming FILE = open('test.txt', 'r') FILE2 = open('test2.txt', 'w') for line in FILE.readlines(): if "key-word" in line: FILE2.write(line) FILE1.close() FILE2.close()

Member Avatar
Member Avatar
+0 forum 8

Hey, I have this very irritating issue which i was unable to solve for a couple of weeks. I am an amateur designer trying to design a site for my company. The problem I face here is this: 1. I create a menu within a container, with the same width of the container. 2. When Zoom in/out (CTRL+scroll) The last element (Contact Us) Shifts to the next line or the whole menu bar is compressed. I have attached the HTML code and the CSS. Please do help me out here. [COLOR="Red"]HTML:[/COLOR] [CODE] <div id="menu"> <ul> <li><a rel="#00CCFF" href="Index.html">Home</a></li> <li><a href="AboutUs.html">About</a></li> …

Member Avatar
Member Avatar
+0 forum 2

import java.util.Scanner; public class BookRentalSystem { public static void main(String args[]) { //Declaration of variable and instances String bTitle, bType, bAuthor, bISBN, bStatus, search; int choice = 1; int bCount = 0; boolean found; Scanner input = new Scanner(System.in); Book[] books = new Book[5]; //Executing user's selection from menu. Exit on 0 while ( choice != 0){ //Menu interface System.out.println( "============= M e n u =============" ); System.out.println( "1. Add a new book" ); System.out.println( "2. Book loan" ); System.out.println( "3. Book return "); System.out.println( "4. Search book" ); System.out.println( "0. EXIT"); System.out.print( "Enter selection: "); choice = input.nextInt(); switch …

Member Avatar
Member Avatar
+0 forum 2

The End.