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 7774155
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T17:18:28+00:00 2026-06-01T17:18:28+00:00

i started studying java about 2 or 3 months ago and i am fairly

  • 0

i started studying java about 2 or 3 months ago and i am fairly sucky at algorithms and i started working on a project and right now i need to figure out an algorithm.

Basically, it should go like this:

x (final output) is randomly chosen from 1 to 50. Simple. However, i want it to gradually get harder to get something high depending on variable y. Check the example below to see what i mean.

Example (Final output is x):
X = 2 while y is 1.
X = 2 while y is 1.
X = 5 while y is 2.
X = 9 while y is 6.
X = 12 while y is 10.
X = 14 while y is 15.`

See where i’m getting? It gradually get harder.
I’m sure it’s not that complicated to do but i can’t figure it out.

Thanks.

  • 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-06-01T17:18:29+00:00Added an answer on June 1, 2026 at 5:18 pm

    in pseudocode:

    Return MIN(rand(1,50), rand(1,50);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just started studying programming about 6 months ago and I have really been
I have recently started studying about threads. I thought of starting from the beginning
I started studying Haskell one week ago and have one strange problem. I created
I started studying android NFC ,I am Confused about NFC tag(i think it is
After spending a couple months studying DDD methodology, I've now began to apply these
I'm new at object oriented programming and we are studying on a Java project.
I started studying windows phone develop. I am now versed with page transitions. I
I have started studying about C++0x. I came across the follow expression somewhere: int
I have just started studying Android, I have limited java knowledge but am semi
I started to use php a few hours ago. To begin studying I decided

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.