What happens when you supply the same name for the input and output files to the LineNumberer program?
just trying to learn about writing data to files
Type: Posts; User: etidd
What happens when you supply the same name for the input and output files to the LineNumberer program?
just trying to learn about writing data to files
hi, :cool:
if someone inputs a number in a word (i.e. "two"), how can i take that input and convert it to an int?
-etidd
i have a LineNumberer program that i wanna know what happens when i supply the name of a nonexistent input file to this program? does it just throw a FileNotFound exception? :confused:
hello again, :cool:
i am trying to loop through an ArrayList of type object. the objects have their own attributes and i'm trying to call a specific method that accesses a specific attribute. in...
hi everyone. how are you?
i have a class square that inherits the rectangle class. what i have is center coordinates of the center of a square. i have figured the arithmetic to getting the coords...
i already figured it out. thanks though.
Given an array of ints, return true if the array contains a 2 next to a 2 somewhere.
has22({1, 2, 2}) → true
has22({1, 2, 1, 2}) → false
has22({2, 1, 2}) → false
public boolean has22(int[]...
help! i can't figure out to sort an array. :confused: i think you're supposed to do it like this:
public int centeredAverage(int[] nums)
{
sort([nums.length - 2] sortedList);
int sum...
Given a string, return a new string where the first and last chars have been exchanged.
frontBack("code") → "eodc"
frontBack("a") → "a"
frontBack("ab") → "ba"
public String frontBack(String...
public class AddTenIntegers
{
public static void main (String[] args)
{
private int sum; ILLEGAL MODIFIER FOR PARAMETER SUM; ONLY FINAL IS PERMITTED
private int i; ILLEGAL MODIFIER FOR...
thank you so much!!! \m/\m/\m/
why is it that when i run this it outputs "0.0" and "F" every time?
import java.util.Scanner;
public class GradeTest
{
public static void main (String[] args)
{
Scanner in = new...
is it soylatte that you download for a jdk package for mac? what do i do to get the compiler set on eclipse?
my idea was to have a couple of local double variables with a constructor public Grade(double value) that constructor's parameter is what receives the user input from the tester class. then, i would...
hey,
help me think of a good way to get after the logic of this program:
:confused:
---------------------
Write a program that translates a number into the closest letter grade. For example,...
hi i have a logic error with my program. it returns and prints unknown for every value. have a look...
what should i even put in the constructor?
public class Card
{
public Card()
{
...
okay, i got it. the last thing is a logic error with the program. i don't know what to put inside the constructor... does it just allow me to make an object in the CardTest class?
okay, i seem to have gotten it... there's only one other issue with the logic of my program.
can someone take a look at the api for the String class and tell me what methods are good for doing a do- while loop to make sure the user put in more than nothing for the program to continue.
...
hi,
i'm writing a program called Card and its tester, CardTest. i find it very difficult to handle the input from the user in between these two programs.
CardTest reads in a card value in such...
yep, sure got it... figured it out myself shortly after posting this. it's great to voice it out to figure it out!
hi help me rewrite the following do loop into a while loop.
int n = 1;
double x = 0;
double s ;
do
{
s = 1.0 / (n * n);
x = x + s;
how do i implement the cosine trig function in java?
hello everyone,
new person here. i'm a college student working on my programming homework. i have a class CashRegister that reads the payment in and calculates change due. i have to add a new...