Create a VBScript script (w2_firstname_lastname.vbs) that takes 3 parameters (numbers)

Instructions
Create a VBScript script (w2_firstname_lastname.vbs) that takes 3 parameters (numbers)
1) Print the product of three numbers
2) Print the sum of the three numbers
3) Print the average of the three numbers
Optionally, you can save the results into a file \”Results.txt\” using the redirection operator \”>\” see sample run below.
4) Make sure to include comment block (flowerbox) in your code.
5) Sample run:-
C:\\entd261>cscript.exe w2_sammy_abaza.vbs 2 3 5 > results.txt
Submit your week 2 work in w2_firstname_lastname.txt (Please save the file as a text file and upload the text file here for final review.)
  
Requirements
Points
 
Comment block (flowerbox) with Instructions on how to run the code with   examples.
20
 
Code documentation and comments.
10
 
Assignment code including creating command line parameter
70
 
TOTAL POINTS
100
Next Question  
1. There are various selection structures that can be used in programming. What are the different relational operators used in selection structures? Provide an example of an if-then-else statement that can be used in a script that performs a system administration task.

ANSWER
Here\’s a VBScript code that takes three parameters (numbers), calculates their product, sum, and average, and optionally saves the results to a file \”Results.txt\” using the redirection operator:

“`vbscript
\’**********************************************************************
\’ Script: w2_firstname_lastname.vbs
\’ Description: Calculate product, sum, and average of three numbers.
\’ Usage: cscript.exe w2_firstname_lastname.vbs > Results.txt
\’ Example: cscript.exe w2_firstname_lastname.vbs 2 3 5 > Results.txt
\’**********************************************************************

\’ Check the number of command-line arguments
If WScript.Arguments.Count < 3 Then WScript.Echo \"Usage: cscript.exe w2_firstname_lastname.vbs > Results.txt\”
WScript.Quit
End If

\’ Get the command-line arguments as numbers
num1 = WScript.Arguments(0)
num2 = WScript.Arguments(1)
num3 = WScript.Arguments(2)

\’ Calculate product, sum, and average
product = num1 * num2 * num3
sum = num1 + num2 + num3
average = (num1 + num2 + num3) / 3

\’ Display the results
WScript.Echo \”Product of the three numbers: \” & product
WScript.Echo \”Sum of the three numbers: \” & sum
WScript.Echo \”Average of the three numbers: \” & average
“`

Save this script as \”w2_firstname_lastname.vbs\” and run it as shown in your sample run example:

“`
cscript.exe w2_firstname_lastname.vbs 2 3 5 > Results.txt
“`

This script will calculate the product, sum, and average of the three numbers and print the results. If you use the redirection operator (\”>\”), it will also save the results to a file named \”Results.txt.\”

Get Free Help with this or a similar assignment from the best assignment AI helper in seconds. Simply past or upload a picture or a document with your assignment instructions/ question and let its handle the rest. Give it a try below!!

How to Use Our AI Homework Solver

Step 1

Enter your question, upload instructions, or paste 
prompt

Step 2

Choose output type: Draft, Detailed Solution, or Step-by-Step Guide

Step 3

Our AI generates your content with research links and references

Why Use Our AI Assignment Helper?

Saves Hours of Brainstorming

No more staring at a blank page. Our AI gives you a strong starting point — so you can focus on refining, not figuring out what to say.

Boosts Writing Clarity and Structure

Messy thoughts? Confusing prompts? Our tool delivers clear, logically structured content that flows — just like a polished draft should.

Helps You Meet Tight Deadlines

Whether it’s due in two hours or overnight, you’ll get instant, reliable help when you need it most — no panic necessary.

Ideal for Complex or Technical Prompts

Messy thoughts? Confusing prompts? Our tool delivers clear, logically structured content that flows — just like a polished draft should.

Supports Research-Based Work

Every answer includes reference links, source ideas, or research cues — so you're not just done, you're also better informed.

Why Use Our AI Assignment Helper?

Features of Our AI Assignment Helper

No Signups. No Barriers.

Jump straight in — no accounts, no logins. Just paste your assignment and get instant help. It’s that simple.

Instant Results, 24/7

Whether it’s midnight before a deadline or mid-morning study break, our AI delivers fast, accurate solutions in seconds — anytime, anywhere.

References Included

Every answer comes with real research links, sources, or citations to guide your learning or help support your submission.

Trained Specifically for Assignments

Unlike generic AI tools, our model is fine-tuned for real academic assignments. Essays, case studies, care plans, reflections — it gets it.

Built for All Levels

From first-year college students to PhD candidates, our AI adjusts to your academic level and writing expectations.

Multiple Output Styles

Need a draft? A detailed answer? A step-by-step guide? We’ve got modes for how you like to work.

TYPES OF PAPER

What Can You Get from Our Writing Service?

Unlock Your Academic Potential with Our

Homework AI Tool

Don’t waste endless hours struggling with homework problems. Question AI assists students with all kinds of academic tasks with 98% accuracy rates. Get detailed answers to challenging homework and exam questions with our powerful AI homework technology.

 

What people say

Helped me understand my legal case study in minutes!
Law Student
The citations saved me hours. I passed!
MBA Student
It is a fantastic way to study math problems with this AI homework helper.
College Student

FAQs

Do I need to sign up to use the tool?

Nope! You can use the tool instantly — no accounts, no logins, and no personal data required.

Yes! You can generate assignment help for free. We believe academic support should be
accessible to everyone.

Our AI supports a wide range of academic tasks — including essays, research papers,
reflections, case studies, reports, presentations, and more — for college, university, master’s,
and even PhD levels.

The AI is trained specifically for academic assignments. It delivers high-quality, structured
responses and even includes references and research links where possible to back up its
solutions.

Absolutely! Choose the Step-by-Step Mode to get a breakdown of how to approach or solve
the question — great for learning and understanding the topic better.

Yes — the content is generated uniquely each time. However, we always recommend
reviewing, editing, and citing properly to match your academic standards.

Yes! Whether its Nursing, Business, Computer Science, Literature, or Law — the tool is built to
adapt to different academic disciplines and writing styles.