Quantcast
Channel: /r/powershell – How to Code .NET
Viewing all articles
Browse latest Browse all 8793

Need a script for a homework assignment

$
0
0

Having a real hard time with this assignment.

It has to be

Have the script ask the user how many sets of numbers the person wants (using an array)

The numbers will be random 1- 59. (ex if you picked 3 you might get 32 , 58, 11)

  1. After that ask the user if they want a total of there numbers?

  2. Ask if they want there list of numbers in one line or straight down in multiple lines. (split?)

  3. At the end ask them if they want random numbers again.

I know it seems simple but i’m a novice and programming isn’t my thing i’m a network major. Want to add that my teacher has not given us a lot to go on. We have learned these things individually but never put them together. This is a study sheet for my mid-term on monday.

This is what I have so far, or if anyone knows where I can teach this to myself as well

Edit: I have been working on it since I posted it and I have the first part working. Here’s what I have so far. Also I am not looking for a handout, I honestly just need HELP with this assignment. If you could offer any advice I will be very appreciative.

Current Code:

$array = @() $num = read-host "how many set of numbers do you want?" $total = 0 cls for($count=0; $count -le $num; $count++) { get-random -Minimum 1 -Maximum 60 } $total = read-host "do you want a total? (y/n)" if($total -eq "y"){write-host $array + ? 

submitted by /u/afi44
[link] [comments]

The post Need a script for a homework assignment appeared first on How to Code .NET.


Viewing all articles
Browse latest Browse all 8793

Latest Images

Trending Articles



Latest Images