Question

I am trying to make the method below, however vect is an object of an immutable...

I am trying to make the method below, however vect is an object of an immutable class and I am confused on how to write the method so that vect can be modified.

/**
   * If active is true: moves _local by vect
   * If active is false: rotate vect by 6.
   */
   public void steep() {
       if (active == true) {
vect.move(_local);
       } else {
vect.rotate(6);
       }
   }

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Could you please share the code with us?So that We can provide you the soultion with proper justice.

Add a comment
Know the answer?
Add Answer to:
I am trying to make the method below, however vect is an object of an immutable...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • I am trying to make a linked list queue and I am trying to use the...

    I am trying to make a linked list queue and I am trying to use the display method I made just to see if its working but when I run it nothing is displayed please help. Also the newPlane boolean was made just so I can randomly decide if the plane is going to join the queue or not. public class PlaneSimulation { public static void main(String[] args) { int landTime = 2; int takeoffTime = 3; int avgArrivalInterval =...

  • I am stuck on trying to get this recursive function's logic to make it work. //Write...

    I am stuck on trying to get this recursive function's logic to make it work. //Write a recursive function that returns true if the sequence of 0 < n integers in A is sorted in non-increasing order and false otherwise. iostream and cmath libraries only bool is_sorted(const int *A, unsigned int n){ if (n == 0) return false; if (A > A+1) return true; else return false; }

  • Below I have my 3 files. I am trying to make a dog array that aggerates...

    Below I have my 3 files. I am trying to make a dog array that aggerates with the human array. I want the users to be able to name the dogs and display the dog array but it isn't working. //Main File import java.util.*; import java.util.Scanner; public class Main {    public static void main(String[] args)    {    System.out.print("There are 5 humans.\n");    array();       }    public static String[] array()    {       //Let the user...

  • WRITE IN JAVA: I've been trying to do this for hours and I can't figure this...

    WRITE IN JAVA: I've been trying to do this for hours and I can't figure this out. I tried the toArray method and I'm stumped. I'm not sure if the remove method is right aswell. If you need anymore info, let me know. I need the following methods completed: toArray Remove ReverseArray /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template...

  • IMPLEMENT AN IMMUTABLE SINGLY LINKED LIST IN JAVASCRIPT ------------------------------------------------------------------------------------------------------------------------- So I am trying to implement a...

    IMPLEMENT AN IMMUTABLE SINGLY LINKED LIST IN JAVASCRIPT ------------------------------------------------------------------------------------------------------------------------- So I am trying to implement a singly linked list that given the below function will pass the bottom four tests when ran. Please help me generate the singly linked list that will work and pass the tests. I will only use this as a reference so please add comments to explain what you are doing so I can understand and write this myself. I think a join method may need...

  • How can I write a unit test for the following java method? (I am using intelliJ)...

    How can I write a unit test for the following java method? (I am using intelliJ) public class ReviewEmployee{ public void EmployeeReview(Employee currentEmployee){ System.out.println("Your recorded hours for the week are: ") + (currentEmployee.getHours()); System.out.println("Your satisfactory rating is: ") + (currentlyEmployee.getRating()); System.out.println("Your bonus is: "); if(currentEmployee.getRating() < 3){ System.out.println(currentlyEmployee.getBonus()); } else{ System.out.println(currentlyEmployee.getBonus() + 500); } } } The Employee class is as follows: Public class Employee{                Private double hours;                Private double rating;                Private double bonus;                Public Employee(double...

  • I am trying to understand the following code I found in a website so that I...

    I am trying to understand the following code I found in a website so that I can use it for a project that evaluates boolean expressions. The code is below but I think it is in java because I do not understand it. Can you help me describe what it is doing in c++ so that I can understand it better? The link to the code is here: https://stackoverflow.com/questions/16762057/algorithm-to-evaluate-value-of-boolean-expression The code is below: public static boolean evaluateBool(String s) { Stack<Object>...

  • Hi so I am currently working on a project for a java class and I am...

    Hi so I am currently working on a project for a java class and I am having trouble with a unit testing portion of the lab. This portion wants us to add three additional tests for three valid arguments and one test for an invalid argument. I tried coding it by myself but I am not well versed in unit testing so I am not sure if it is correct or if the invalid unit test will provide the desired...

  • This is my code for family tree, but i am confused on how to make a...

    This is my code for family tree, but i am confused on how to make a main class that will use these methods.   public class FamilyTree { private class Node { String name; Node next; Node child; public Node(String name) { this.name = name; next = null; child = null; } }    public Node addSibling(Node node, String name) { if(node == null) return null; while(node.next != null) node = node.next; return(node.next = new Node(name)); }    public Node addChild(Node...

  • This is my code for a TicTacToe game. However, I don't know how to write JUnit...

    This is my code for a TicTacToe game. However, I don't know how to write JUnit tests. Please help me with my JUnit Tests. I will post below what I have so far. package cs145TicTacToe; import java.util.Scanner; /** * A multiplayer Tic Tac Toe game */ public class TicTacToe {    private char currentPlayer;    private char[][] board;    private char winner;       /**    * Default constructor    * Initializes the board to be 3 by 3 and...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT