DescriptionYou will have to write three different programs to: 1. Accept inputs from user. 2. Use Decision Structures (if, elif, else) to evaluate multiple expressions which produce True or False as...

1 answer below »
DescriptionYou will have to write three different programs to: 1. Accept inputs from user. 2. Use Decision Structures (if, elif, else) to evaluate multiple expressions which produce True or False as outcome and then use Boolean Logic to process further. 3. Use functions which passes on user inputs to a function which performs the operation and returns the result which will be displayed on the console. 4. Use while (condition controlled), for (count controlled) loop in programs, or nested looping. 5. Uses files – open, read/write, delete to handle data. 6. Uses exception handling – try and except to catch and handle exceptions. Value, data Type, Zero Division, Syntax Error, Runtime Exception and others. Program expectation: The student must be able to explain the working of the program and its logic. The program should be indented, proper comments should be given, variable names and data types should be chosen appropriately. The program should compile and execute to display the result. The student must use programming constructs available in Python and follow coding standards.
Details:Three different program files must be uploaded. The First program must accept inputs from a user, repeats a sequence of instructions a certain number of times, or until some specific result is achieved. Use while (condition controlled), for (count controlled) loop in programs, or nested looping. The Second program must accept inputs from a user, performs an operation using a userdefined function which will accept parameters and return result displayed on the console. As a part of the program use Decision Structures (if, elif, else). The Third program needs to handle data from files (open, read/write, delete to handle data). It uses exception handling – try and except to catch and handle exceptions. Follow coding standards, naming conventions for variables and functions. Students will be asked to explain the working of their program and the logic they’ve used. All three program files must be submitted for the assessment through the Assessment 2 A Turnitin link on Moodle page for this unit
Answered 1 days AfterOct 02, 2021

Answer To: DescriptionYou will have to write three different programs to: 1. Accept inputs from user. 2. Use...

Neha answered on Oct 03 2021
128 Votes
92602 - lab 4 and 7/Assignment4B.cs
using System;
public class Assignment4B
{
public s
tatic void Main()
{
int i,j,row = 3;
bool stop = false;
while (!stop)
{
    Console.Write("\n\n");
Console.Write("Display the pattern like diamond:\n");
Console.Write("-----------------------------------");
Console.Write("\n\n");
Console.Write("Input number of rows (half of the diamond) :");
row = Convert.ToInt32(Console.ReadLine());
if(row % 2 == 0)
{
string statement = string.Format("To make a diamond, we’ll use {0} as the width instead.", row+1);
Console.Write(statement);
}
if (row < 3)
{
Console.Write("Please enter a width of at least 3: ");
}
else
{
stop = true;
}
}
row = (row/2)+1;
for(i=0;i<=row;i++)
{
for(j=1;j<=row-i;j++)
Console.Write(" ");
...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here