Create an application that picks the Powerball number. In powerball, you pick 5 random numbers between 1 and 69, and a "powerball" number between 1 and 26. The first 5 numbers cannot be repeats of...

1 answer below »
Create an application that picks the Powerball number.
In powerball, you pick 5 random numbers between 1 and 69, and a "powerball" number between 1 and 26. The first 5 numbers cannot be repeats of themselves (in otherwords you cannot have 5,3,7,5,8 because you have the number 5 twice.)
Your app should have a function to generate a single random number between 1 and a maximum number.
Your app should have an Array or ArrayList of TextViews for the first 5 TextView fields in your application design.
Your app should check to make sure that none of the first 5 numbers generated are repeated. (Hint: this requires another array)
This needs to de done in Android Studio in Kotlin Language.
Answered 1 days AfterNov 04, 2021

Answer To: Create an application that picks the Powerball number. In powerball, you pick 5 random numbers...

Shubham Kumar answered on Nov 05 2021
125 Votes
Return/PowerBall.zip
PowerBall/.gitignore
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build
/captures
.externalNativeBuild
.cxx
local.properties
PowerBall/app/.gitignore
/build
PowerBall/app/build.gradle
plugins {
id 'com.android.application'
id 'kotlin-android'
}
android {
compileSdk 31
defaultConfig {
applicationId "com.example.powerball"
minSdk 21
targetSdk 31
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
}
dependencies {
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'com.google.android.material:mate
rial:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
PowerBall/app/proguard-rules.pro
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
PowerBall/app/src/androidTest/java/com/example/powerball/ExampleInstrumentedTest.kt
package com.example.powerball
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.Assert.*
/**
* Instrumented test, which will execute on an Android device.
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
@Test
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("com.example.powerball", appContext.packageName)
}
}
PowerBall/app/src/main/AndroidManifest.xml









PowerBall/app/src/main/java/com/example/powerball/MainActivity.kt
package com.example.powerball
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.widget.Button
import android.widget.TextView
import java.util.Random
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
val pickButton = findViewById
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here