Question

Using the Windows Starter Visual Studio project create the following two programs. 1. Write a program...

Using the Windows Starter Visual Studio project create the following two programs.

1. Write a program that will loop three times and raise the number 25 to the third power (25pts).
(25*25*25) Note: Make sure you have a large enough memory for the final number

2. Write a program using a whileSum that adds one to the index until it is five (25pts).

Sample:

        mov sum, 0     ; sum := 0

        mov ecx, 1     ; count := 1

whileA: cmp sum, 1000 ; sum < 1000 ?

        jnl endwhileA ; exit if not

        add sum, ecx   ; add count to sum

        inc ecx        ; add 1 to count

        jmp whileA     ; repeat

endwhileA:

mov eax, nmbr
whileCount: cmp icount, 3
jnl endwhileCount
imul eax, 25
mov rslt, eax
add icount, 1
jmp whileCount
endwhileCount:

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Question 1:

Here a new Console Application in C# is created using Visual Studio 2017 with name "Demo_Loop".This application contains a class with name "program.cs".Below are the files associated with this program.

Program.cs :

//namespace
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
//application namspace
namespace Demo_Loop
{
class Program//Class
{
//Main method
static void Main(string[] args)
{
//declaring variable
int sum = 0;
//for loop will execute three times
for (int i = 0; i < 3; i++)
{
//calculate and add to sum
sum = sum + 25 * 25 * 25;
}
Console.WriteLine("Sum is : "+sum);
//display sum
}
}
}

======================================================

Output : Run application using F5 and will get the screen as shown below

Screen 1 :Program.cs

***********************************************************

Question 2 :

Here a new Console Application in C# is created using Visual Studio 2017 with name "Demo_BasicApp".This application contains a class with name "program.cs".Below are the files associated with this program.

Program.cs :

//namespace
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
//application namespace
namespace Demo_BasicApp
{
class Program //Class
{
//Main method
static void Main(string[] args)
{
//declaring variable
int index = 0,sum = 0;
//while loop will execute till index is less than 5
while(index <5)
{
index = index + 1;//increment value of i
sum = sum + index;//calculate sum
}
//display index and Sum
Console.WriteLine("Value of Index :"+index+" Sum :"+sum);
//to hold the screen
Console.ReadLine();
}
}
}

======================================================

Output : Run application using F5 and will get the screen as shown below

Screen 1 :Program.cs

Add a comment
Know the answer?
Add Answer to:
Using the Windows Starter Visual Studio project create the following two programs. 1. Write a program...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Using the Windows Starter Visual Studio project create the following five programs. 1. Write a p...

    Using the Windows Starter Visual Studio project create the following five programs. 1. Write a program that will store address information in unique values and then display the full address in a window at runtime (10pts). Example: Sam Coder 1 Main Street Kansas City, MO 64018 2. Write a program that will swap the City and State fields and then display the full address in a window at runtime (10pts). Example: Sam Coder 1 Main Street MO, Kansas City 64018...

  • I need help creating this code. Write an assembly program (MASM and Irvine's libraries) that calculates...

    I need help creating this code. Write an assembly program (MASM and Irvine's libraries) that calculates and prints out the first five Fibonacci numbers FO=0; F1=1; F2=1; F3=F1+F2; F4=F3+F2; F5=F4+F3 If we use 0, 1 and initial conditions the sequence would be: 0, 1, 1, 2, 3 Use the ebx, eax, and ecx registers. Note WriteHex, Writelnt, WriteDec, all use eax So use ebx for first and eax for second and ecx for temporary The calculation could go something like...

  • **This program is to be created using Visual Studio C#**Create as a Windows Form application** 1....

    **This program is to be created using Visual Studio C#**Create as a Windows Form application** 1. Output a header in the console: “This is a replacement program” 1. Output a header that states: “This is Program 5” 2. Output a thank you message: “Thank you for running the program.”

  • Please write below code in C++ using Visual Studio. Write program that uses a class template...

    Please write below code in C++ using Visual Studio. Write program that uses a class template to create a set of items. The program should: 1. add items to the set (there shouldn't be any duplicates) • Example: if your codes is adding three integers, 10, 5, 10, then your program will add only two values 10 and 5 • Hint: Use vectors and vector functions to store the set of items 2. Get the number of items in the...

  • Create a C# program using WINDOWS FORM App in Visual Studio. THE ANSWER MUST BE IN...

    Create a C# program using WINDOWS FORM App in Visual Studio. THE ANSWER MUST BE IN C#, IN WINDOW FORM APP, IN VISUAL STUDIOS. Write the code to: Write a method called MaximumDiffrence that accepts an integer array as a parameter and return the maximum difference between adjacent values in the array, where the gap is defined as the absolute value of the difference between the 2 adjacent values. Example: if the array contains {5, 7, 4, 9, 6, 12,...

  • Using Microsoft Visual Studio. 1) Complete the following C++ program by adding more line of code...

    Using Microsoft Visual Studio. 1) Complete the following C++ program by adding more line of code for 8-bit signed array, 16-bit unsigned array, 16-bit signed array, 32-bit signed array and 32-bit signed array. 2) Fill in all the blanks in Table 1 using your completed code, following the hints provided within the table. 3) Fill in all the blanks in Table 2 using your completed code, following the hints provided within the table. C++ Program #include <stdio.h> #include <iostream> int...

  • **This program is to be created using Visual Studio C#**Create as a Windows Form application** 1....

    **This program is to be created using Visual Studio C#**Create as a Windows Form application** 1. Output a header in the console: "Program 1" 2. Next you will ask the user to enter three floats and read the values into variables. 3. Perform addition, multiplication, and division examples with the numbers entered. 4. Implicitly cast the floats into doubles. 5. Explicitly cast the floats into ints. 6. Use conversion methods to convert the floats into strings. 7. Ask the user...

  • Create the following two programs in assembly language: 1. Write a program that will call a...

    Create the following two programs in assembly language: 1. Write a program that will call a procedure to push the following Decimal value into eax - 31000 and then clear the register using pop. 2. Write a program that will call a procedure to use minMax to push an array values into eax register.

  • C++ and Using Microsoft Visual Studio. Write 2 programs: One program will use a structure to...

    C++ and Using Microsoft Visual Studio. Write 2 programs: One program will use a structure to store the following data on a company division: Division Name (East, West, North, and South) Quarter (1, 2, 3, or 4) Quarterly Sales The user should be asked for the four quarters' sales figures for the East, West, North, and South divisions. The data for each quarter for each division should be written to a file. The second program will read the data written...

  • Write a program using Visual Studio 2017 that accepts four (4) lines of input: • The...

    Write a program using Visual Studio 2017 that accepts four (4) lines of input: • The first line contains a float value in 4.2f format • The second line contains a char value • The third line contains a 4-digit int value • The fourth line contains a char value and then displays all of the input on a single line Phone Number Write a program that accepts a phone number of the form +1(xxx)-xxxxxxx where x is a digit,...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT