logo Hurry, Grab up to 30% discount on the entire course
Order Now logo

Ask This Question To Be Solved By Our ExpertsGet A+ Grade Solution Guaranteed

expert
Penn RitchieSociology
(5/5)

832 Answers

Hire Me
expert
Woodrow BinionAccounting
(5/5)

659 Answers

Hire Me
expert
Natalia GCriminology
(5/5)

690 Answers

Hire Me
expert
Jude NnajiLaw
(5/5)

807 Answers

Hire Me
Others
(5/5)

For the exercises below, use a subroutine to break up the code

INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS

Student Accounts

Username: CSULB-### (### represents the number assigned to you, e.g. 033)

Password: global7 (This is the initial password, you will need to change it at login)

 

Tutorial 4 – ABAP4 Subroutines

Turn in the following for each exercise:

a. Code listing (Text.  This can be copy/pasted to test the code)

b. Results screen shot

 

Exercises

For the exercises below, use a subroutine to break up the code (modularize it).

Review the requirements of each subroutine:

The inputs

The returned value

 

The subroutine is to return value requested only.  It should not perform any other tasks.

In addition to modularizing the code, this will allow for code reuse.

 

1. Recall ZZ_###_STUDENTLEVEL that you created in a previous assignment:

User inputs how many units they have earned.

The program outputs their student level as follows:

0 – 30 units earned – Freshman

31 – 60 units earned – Sophomore

61 – 90 unites earned – Junior

> 90 – Senior

 

If a negative number is entered, the program writes:

Invalid input.  Units earned must be a positive number.

 

Create a revised version that uses a subroutine: ZZ_###_STUDENTLEVEL_SUB

Your main program will call a subroutine that performs the following:

Input:  Number of Units

Output: Student Level.

 

NOTE:

Your subroutine is to return the student level only.

It does not perform any other tasks: data validation, output to user, etc.

Your main program is to treat the subroutine as a “black box”.

You provide the requested input (number of units) and it returns the student level.

 

2. a. 

Create a program to print the first fifty prime numbers:  ZZ_###_PRIMENUMBERS.

Your main program is to loop until you get 50 prime numbers.  The main program will call a subroutine that performs the following:

Input:  A number

Output:  A single character 

‘Y’  - Yes, the number is prime

‘N’ – No, the number is not prime.

 

Again, your subroutine is a “black box”.  

Input is a number, and it returns “Y” or “N”.

It does not do anything else: validations, output to the user, etc.

(5/5)
Attachments:

Related Questions

. The fundamental operations of create, read, update, and delete (CRUD) in either Python or Java

CS 340 Milestone One Guidelines and Rubric  Overview: For this assignment, you will implement the fundamental operations of create, read, update,

. Develop a program to emulate a purchase transaction at a retail store. This  program will have two classes, a LineItem class and a Transaction class

Retail Transaction Programming Project  Project Requirements:  Develop a program to emulate a purchase transaction at a retail store. This

. The following program contains five errors. Identify the errors and fix them

7COM1028   Secure Systems Programming   Referral Coursework: Secure

. Accepts the following from a user: Item Name Item Quantity Item Price Allows the user to create a file to store the sales receipt contents

Create a GUI program that:Accepts the following from a user:Item NameItem QuantityItem PriceAllows the user to create a file to store the sales receip

. The final project will encompass developing a web service using a software stack and implementing an industry-standard interface. Regardless of whether you choose to pursue application development goals as a pure developer or as a software engineer

CS 340 Final Project Guidelines and Rubric  Overview The final project will encompass developing a web service using a software stack and impleme