Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6346065
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T20:56:49+00:00 2026-05-24T20:56:49+00:00

I wrote an android app that solves quadratic equations and then is supposed to

  • 0

I wrote an android app that solves quadratic equations and then is supposed to graph them. The library I am using requires the data sets to be in ArrayList form. However the loop I have to create the array involves adding a double to them which you cannot do with array lists. Here is the code:

List<double[]> x = new ArrayList<double[]>();
List<double[]> values = new ArrayList<double[]>();
QuadraticActivity c = new QuadraticActivity();


x=(c.xValueArr);
values=(c.yValueArr);

for (; c.xCurrent <= c.xEnd; c.xCurrent += c.xStep) {
    double yCurrent = (c.a)*Math.pow(c.xCurrent, 2) + (c.b)*c.xCurrent + (c.c);
    c. xValueArr .add ((c.xCurrent));
    c. yValueArr .add ((yCurrent));
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T20:56:50+00:00Added an answer on May 24, 2026 at 8:56 pm

    Judging from your code, c.xValueArr and c.yValueArr are of type, double[]. If so, then just change the first 7 lines of code to this:

    QuadraticActivity c = new QuadraticActivity ();
    ArrayList<Double> x = Arrays.asList (c.xValueArr);
    ArrayList<Double> values = Arrays.asList (c.yValueArr);
    

    Note: You’re instantiating two new ArrayLists in lines 1 and 2 but are replacing them in lines 6 and 7. Also, you’ll have to add the new values inside the loop manually, as x and values don’t point to the same arrays as c‘s arrays. A better fix would be to declare and initialize x and values after the iteration, but since you didn’t include a closing }, I’m assuming you need them in the iteration.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wrote a windows service using VB that read some legacy data from Visual
I wrote some app that using lauot- procce bar and AsyncTask to do some
I have a Android app that connects to a server using Object streams all
I wrote an Android App using the Mixare ( link to mixare project )
I am working on an app for android using phonegap and unity. I wrote
I'm trying to write a voip app for Android, using the Android SIP API
I am making an android app that shows the Calendar day view, it looks
In my current app for Android I have an HTTP client that sends a
I have an app that potentially tracks a large amount of data during app
I'm trying to write an Android app that will allow a user to search

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.