LogisimTinyCPU Programming
Provide the following
ANSWER :
Given question is related to Decision making:
Decision making is nothing but if a given condition is satisfied --> execute some block of code if not satisfies then some other block of code has to get executed.
similarly
switch case is also a decision making statement generally available in c language.
Pseudocode
1)Take input A
2)if A>5
2.1) display 1
2.2)goto step 4
3) if A<=5
3.1)display -1
3.2)goto step 5
4)EXIT
FLOWCHART
Main.java
import java.util.Scanner;
public class Main{
public static void main(String []args){
Scanner sc=new Scanner(System.in);
int A=sc.nextInt();
if(A>5)
System.out.println(1);
else
System.out.println(-1);
}
}
Explaination:
if A>5 we prints 1
else block is executed if a<=5
OUTPUT
LogisimTinyCPU Programming Input A as a signed number, at any cell you like If A is...
guys can you please help me to to write a pseudo code for this
program and write the code of the program in visual studio
in.cpp.
compile the program and run and take screenshot of the output
and upload it. please help is really appreciated.
UTF-8"CPP Instruction SU2019 LA X 119SU-COSC-1436- C Get Homework Help With Che X Facebook -1.amazonaws.com/blackboard.learn.xythos.prod/584b1d8497c84/98796290? response-content-dis 100% School of Engineering and Technology COSC1436-LAB1 Note: in the instruction of the lab change "yourLastName" to your last...
Write a program in MIPS assembly language that implements the DESCENDING bubble sort algorithm to sort a variable-sized array of signed 32-bit integers (words)that are read from the console. Be reminded that in a descending sort, the integers are sorted from the largest to the smallest. A “special value” 99999 will beused to signify the end of the input sequence. This value is not to be considered part of the input data set. However, any value greater than 99999 that...
Java programming for ticket price calculator. It should ask the user if they would like to process another ticket order. They should indicate their selection with a Y or N. If they indicate yes, then it should repeat the entire program with the exception of the welcome screen. If they indicate no, it should show the final thank you message and end the program. If they indicate an invalid answer, it should display an error and re-prompt them for a Y...
Help with programming in C++
Phase 1 is complete, please help with phase 2. Thank you.
Phase 1
You must design 3 algorithms, and provide
both a flow chart and pseudo code for the
algorithms.
Algorithm descriptions:
Given an integer parameter named current_number
and two constant global variables:
const int MIN_NUMBER = 1;
const int MAX_NUMBER = 8;
Create an algorithm named forward, that will
advance ONE value through a sequence of numbers 1,
2, 3 ... MAX_NUMBER. In...
*Help Please with the code**
CSIT 345 Lab 2 Process Programming Your lab requirement is to write program codes for 3.21 and shared memory program for producer and consumer as shown in the following. You can start with the code provided in the virtual machine in the virtual box you installed. The code can be found in /home/oscreader/osc9e-src/ch3 a. For 3.21, you can start with the newprocposix.c and modify the code to meet your requirement. Then type: gcc neypCOCROSİS.c to...
Create an algorithm to count the number of 1’s in a 32-bit number. Implement the program in a high level language like C or Java. It does not need to run for me, but the code should be included in a text document called FirstnameLastnameHLA3.txt along with your assignment submission. Implement the program in MIPSzy Assembly language. Use the high level code as comments to the right of the Assembly code as the textbook does. If you write that MIPSzy...
Create another program that will prompt a user for input file. The user will choose from 4 choices: 1. Display all positive balance accounts. 2. Display all negative balance accounts. 3. Display all zero balance accounts. 4. End program. C PROGRAMMING my code so far #include<stdlib.h> #include<stdio.h> int main(void) { int request; int account; FILE *rptr; char name[20]; double balance; FILE *wptr; int accountNumber; if((wptr = fopen("clients.dat","w")) == NULL) { puts("File could not be opened"); } else {...
3 Programming Question (45 points) 3.1 Instructions You need to write the code by yourself. Your implementation must use C/C++ and your code must run on the Linux machine general.asu.edu. Please refer to the programming guide (available under the Assignments folder on Blackboard) for using the general.asu.edu server, as well as compiling and running C/C++ code under Linux For this question, you need to provide a Makefile that compiles your program to an executable named a3 that runs on the...
#1 To execute a correctly written program, you first need to _____. highlight the output commands in the code print the code for reference compile it to machine language compile it from machine language into the programming language of choice #2 Adding capabilities to working software is called the _____ phase. coding maintenance debugging brainstorming #3 A rectangle in a flowchart represents which of the following? One or more I/Os ...
Programming Exercise 4.6
Use the strategy of the decimal to binary conversion and the bit
shift left operation defined in Project 5
bits = input("Enter bit string: ")
bits = bits[1:] + bits[0]
print ("Result:", bits) to code a new encryption algorithm.
The algorithm should
Add 1 to each character’s numeric ASCII value.
Convert it to a bit string.
Shift the bits of this string one place to the left.
A single-space character in the encrypted string separates the
resulting...