Section 1
.pdf
keyboard_arrow_up
School
Simmons College *
*We aren’t endorsed by this school
Course
350
Subject
Computer Science
Date
Apr 25, 2024
Type
Pages
6
Uploaded by miraclezexist on coursehero.com
6/6/2021
Section 1.10 - COMPE 160: Introduction to Computer Programming
https://learn.zybooks.com/zybook/SDSUCOMPE160PaoliniSpring2021/chapter/1/section/10
1/6
"My program is correct, but the system is complaining about output whitespace. "
1.10 Why whitespace matters
Whitespace and precise formatting
For program output, whitespace
is any blank space or newline. Most coding activities strictly
require a student program's output to exactly match the expected output, including whitespace.
Students learning programming often complain:
However, correctness often includes output being formatted correctly.
PARTICIPATION
ACTIVITY
1.10.1: Precisely formatting a meeting invite.
1. This program for online meetings not only does computations like scheduling and
creating a unique meeting ID, but also outputs text formatted neatly for a calendar
event.
2. A calendar program may append more text after the meeting invitation text.
3. The programmer of the invitation on the right wasn't careful with whitespace. "Join
meeting" is buried, the link is hard to see, and the "Phone" text is dangling at a line's
end.
4. The programmer also didn't end with a newline, causing subsequent text to appear at
the end of a line, and even wrap to the next line. This output looks unprofessional.
Kia Smith is inviting you to a video meeting. Join meeting: http://www.zoomskype.us/5592 Phone: 1-669-555-2634 (San Jose) 1-929-555-4000 (New York) Meeting ID: 5592 -------------------------
Reminder: 10 min before
Kia Smith is inviting you to a video meeting. Join meeting: http://www.zoomskype.us/5592 Phone: 1-669-555-2634 (San Jose) 1-929-555-4000 (New York) Meeting ID: 5592 -------------------------
Reminder: 10 min
before
F
db
k?
Captions
Start
2x speed
6/6/2021
Section 1.10 - COMPE 160: Introduction to Computer Programming
https://learn.zybooks.com/zybook/SDSUCOMPE160PaoliniSpring2021/chapter/1/section/10
2/6
PARTICIPATION
ACTIVITY
1.10.2: Program correctness includes correctly-formatted output.
Consider the example above.
1)
The programmer on the
left intentionally inserted
a newline in the ±rst
sentence, namely "Kia
Smith ... video meeting".
Why?
2)
The programmer on the
right did not end the ±rst
sentence with a newline.
What effect did that
omission have?
3)
The programmer on the
left neatly formatted the
link, the "Phone:" text, and
phone numbers. What did
the programmer on the
right do?
Feedback?
Probably a mistake
So the text appears
less jagged
To provide some
randomness to the
output
Correct
The two resulting lines are closer to the same length,
which may look more appealing to a reader. On the right,
the text just wraps when reaching the end, which isn't as
neat.
"Join meeting"
appears on the
same line
No effect
Correct
On the left, "Join meeting" is clearly visible due to a
preceding blank line. But on the right, "Join meeting" is
easy to miss, appearing directly after the previous
sentence.
Also neatly
formatted those
items
Output those items
without neatly
formatting
Correct
The output on the right is not neatly formatted. The link is
harder to see, and "Phone" is in the wrong place due to a
missing newline.
6/6/2021
Section 1.10 - COMPE 160: Introduction to Computer Programming
https://learn.zybooks.com/zybook/SDSUCOMPE160PaoliniSpring2021/chapter/1/section/10
3/6
4)
On the right, why did the
"Reminder..." text appear
on the same line as the
separator text "------"?
5)
Whitespace _____
important in program
output.
Programming is all about precision
Programming is all about precision
. Programs must be created precisely to run correctly. Ex:
= and == have different meanings.
Using i where j was meant can yield a hard-to-±nd bug.
Declaring a variable as int when char was needed can cause confusing errors.
Not considering that n could be 0 in sum/n can cause a program to fail entirely in rare but
not insigni±cant cases.
The difference between typing x/2 vs. x/2.0 can have huge impacts.
Counting from i being 0 to i < 10 vs. i <= 10 can mean the difference between correct
output and a program outputting garbage.
In programming, every little detail counts. Programmers must get in a mindset of paying
extreme attention to detail
.
Thus, another reason for caring about whitespace in program output is to help new
programmers get into a "precision" mindset when programming. Paying careful attention to
details like whitespace instructions, carefully examining feedback regarding whitespace
differences, and then modifying a program to exactly match expected whitespace is an exercise
in strengthening attention to detail. Such attention can lead programmers to make fewer
mistakes when creating programs, thus spending less time debugging, and instead creating
programs that work correctly.
PARTICIPATION
ACTIVITY
1.10.3: Thinking precisely, and attention to detail.
Because programs
behave erratically
Because the
programmer didn't
end the output with
a newline
Correct
Programs should almost always end with a newline, so
that any subsequent text appears on a separate line.
Here, not only does the next text "Reminder..." appear on
the same line (which looks bad), but that text also wraps,
making the text even harder to read.
is
is not
Correct
Learners often want to ignore whitespace, but most
programs that have output must take care to create neat
output, with spaces and newlines carefully placed (and
usually ending with a newline).
Feedback?
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
Related Questions
1. Explain what a selection statement is in a sentence or two along with an example.
2. Explain what a loops are in a sentence or two along with an example.
3. Explain what arrays are in a sentence or two along with an example.
4. Give an example that uses selection statements, loops, and arrays together to accomplish an important task.
5. Is it possible to replace a selection statement with a loop? Is it possible to replace a loop with a selection statement? Clearly and concisely argue your position.
No hand written and fast answer with explanation
arrow_forward
Program in Java
Modify the Ceiling Tile program:
• Read from a file the input information (you can use the tile.txt file)
• Store the tile size information in arrays
• Display to the console the information you read from the file
• Display your calculations.
arrow_forward
5. Design an algorithm that asks the user for the name of a text file containing a grid of numbers
and loads it into a 2D array of integers (think like an image without the color channel), then
outputs the index (row, col) of the SMALLEST number in the array.
Libraries:
Input:
Output:
Design Pattern:
Search
Find Min
Find Max
Find All
Principal Mechanisms (select all that apply):
Single Loop
Conditional (if/else) statement
Nested Loop
split()
Indexing / Slicing
☐ input ()
Process (as a concise and precise LIST OF STEPS/ pseudocode):
(Assume libraries have already been imported.)
arrow_forward
InClass Exercise Task01 (V1.0)Requested files: Inclass_Task01.java ( Download)Type of work: Individual workThe Namibia University of Science and Technology would like to introduce an automated student number and email generation system. The system takes into consideration the following:
a) To generate the student number it takes three letters(the first, middle and last letter) of the student’s surname and adds it to the first three letters from the first name, then finally adds a three digit postfix number.
b) To generate the email is quite easy it just takes the first letter from the first name and adds it to the surname , then it adds the @students.nust.na postfix
Your task is to create a program that can achieve the above requirements when given the students surname, first name and three digit postfix through CMD arguements
Sample run 1:
java InClass01_task01 Kandjeke Jenifer 003
Output: Good day Jenifer welcome to NUST.
Your email address is : jkandjeke@students.nust.na
Student…
arrow_forward
I want to read the text from the file and put it into parallel arrays in c++
For example lest assume following text is in file
"i am 17.5"
"i am 18.5"
"i am 19.5"
I want to read this text from the file and put it into parallel arrays so it should have one column for i one for am and one for numbers
arrow_forward
Programming Language: C++
6. Separate compilation was useful in older programming languages, but having multiple files adds an unnecessary layer of complexity and is discouraged in modern programming languages. = true or false?
arrow_forward
PLEASE WRITE IN JAVA USING ECLIPSE IED
Objective:
Write a program using the main method where it searches through an array of integer values and prints out the minimum even and odd values.
Requirements:
Functionality. (20pts)
No Syntax Errors. (20pts*)
*Code that cannot be compiled due to syntax errors is nonfunctional code and will receive no points for this entire section.
User Inputs the size and values of the array. (5pts)
The program must ask the user for the size of the array. This value must be strictly greater than zero, otherwise the program must print “Invalid Array Size” and immediately terminate. Otherwise, the program must create an array of integers of that size.
The program must ask the user to input each value, and then must store those values into the array.
All must apply for full credit.
Find the Minimum Even Value. (5pts)
The program must then determine the minimum even value found in the array.
The program must not assume that the first value in the array is…
arrow_forward
1
2
3
4 5
programming questions / 1. Find the factors of an interger
[Question Description] Writer a program that read an interger and displays all its smallest factors in increasing order.
[Input Format] an interger
[Output Format] all its smallest factors in increasing order
[Input Example] 120
[Output Example] 22235
Submit source files Choose file No file chosen
提交
Note: Programs can only be written in the C++ language. If there are multiple source files, compress them into a rar zip package submission.
operation result
code not yet submitted
Speaking:
arrow_forward
java language coding please
Object Relationship and File IO
Write a program to perform statistical analysis of scores for a class of students. The class may have up to 40 students.There are five quizzes during the term. Each student is identified by a four-digit student ID number.
The program is to print the student scores and calculate and print the statistics for each quiz. The output is in the same order as the input; no sorting is needed. The input is to be read from a text file. The output from the program should be similar to the following:
Here is some sample data (not to be used) for calculations:
Stud Q1 Q2 Q3 Q4 Q5
1234 78 83 87 91 86
2134 67 77 84 82 79
1852 77 89 93 87 71
High Score 78 89 93 91 86
Low Score 67 77 84 82 71
Average 73.4 83.0 88.2 86.6 78.6
The program should print the lowest and highest scores for each quiz.
Plan of Attack
Learning Objectives
You will apply the following topics in this assignment:
File Input operations.
Working and…
arrow_forward
Instruction: Create a Java programming code that:
Use if-else or switch-case statements.Apply the corresponding looping statement.
Program Specification:1. Use two-dimensional array with size 7 columns and 5 rows.2. Seat numbers are populated during run-time and not hard-coded.3. User is asked to input a seat number.4. The chosen seat number is replaced by the letter X.5. Program displays a remark “Seat successfully reserved” when reservation is done.
6. The user is not allowed to reserve a previously reserved seat. Display “Seat istaken” remarks.7. The user is not allowed to enter an invalid seat number. Display an errormessage.8. The program continuously loops.
Sample Output:
1 2 3 4 5 6 78 9 10 11 12 13 1415 16 17 18 19 20 2122 23 24 25 26 27 2829 30 31 32 33 34 35Enter seat number to reserve: 111 2 3 4 5 6 78 9 10 X 12 13 1415 16 17 18 19 20 2122 23 24 25 26 27 2829 30 31 32 33 34 35Enter seat number to reserve:
arrow_forward
Programming: C#(C sharp)
without using (array, while and furthermore advance loop)
Someone i know posted this here already but he got the wrong answer. I was hoping i can get the right one.
arrow_forward
Assignment for Computer Architecture:
N Factual by Recusion
*please have comments in the code*
You are to write a program in MIPS that computes N! using recursion. Remember N! is the product of all the numbers from 1 to N inclusive, that is 1 x 2 x 3 x (N – 1) x N. It is defined as 1 for N = 0 and is undefined for values less than 0.
The programs first requests the user to input the value of N (display a prompt first so the user knows what to do). If the input value is less than 0, the program is to display “N! undefined for values less than 0” and then requests the user to input the value of N again. If the value input is non-negative, it is to compute N! using a recursive function, that is one that calls itself.
You are to have your name, the assignment number, and a brief description of the program in comments at the top of your program. Since this is an assembly language program, I expect to see comments on almost every line of code in the program. Also make the…
arrow_forward
Examples
For examples 1 to 4, you must create the data files with a text tool, such as Notepad
exampleOne
This program reads data from a physical file, create a reference to the file, perform a computation,
display the result,
close the file
package chario;
import java.util.Scanner;
import java.io.*;
//
public class Chario {
//
public static void main(String[] args) throws IOException
{
File file1 = new File("fileOne.txt"); //Create a reference to the physical file
/* Use Notepad to create a text file named fileOne.txt which must be in the same directory that src is in
To find src, open your project in NetBeans and hover its name, which is in the top left just below the Projects menu; this will display the path to your project
My project path is, yours will be different I:\\Ajava\161\WPPractice\IO\charstream\charioMy fileOne.txt is located in chario
*/
Scanner getit = new Scanner( file1 ); // connect a Scanner to the file…
arrow_forward
Program for simulation of grep unix commands algorithm(C language)STEP1: Start the program STEP2: Declare the variables fline[max], count=0, occurrences=0 and pointers *fp, *newline. STEP 3: Open the file in read mode.STEP4: In while loop check fgets(fline,max,fp)!=NULL STEP 5: Increment count value. STEP 6: Check newline=strchr(fline, „\n‟) STEP 7: print the count,fline value and increment the occurrence value. STEP 8: Stop the program
arrow_forward
Create a program that implements a music playlist using structure and files. The program must continue to run until the user picks exit.
Functionalities:
1. Create two structures. One for the playlist with the details: name, song count, array of songs (size 10) and one for the song with the details: title, artist, album.
2. The program must load the data each time it is ran and must save the data each time the user picks exit.
(a) Save Data
- You must check whether there is a data to be saved. If there are none, simply print a prompt saying so. Also, save count as 0, so that you will be able to keep track if the file is empty.
- The format of the saved data must follow this: *refer to the photo below*
(b) Load Data
- You must check whether the file exists. If the file exists, check if the count is 0. If the count is not 0, read each of the data in the file and save it in the array of structures.
3. Create a menu that shows:
(a) Add Playlist
- The user can put up to 10 playlists in the…
arrow_forward
Art.java
In this part you will create a program Art.java that produces a recursive drawing of the design attached in the picture.
Requirements
Art.java must take one (1) integer command-line argument n that controls the depth of recursion.
Your drawing must stay within the drawing window when n is between 1 and 7. (The autograder will not test values of n outside of this range.)
You may not change the size of the drawing window (but you may change the scale). Do not add sound.
Your drawing can be a geometric pattern, a random construction, or anything else that takes advantage of recursive functions.
Optionally, you may use the Transform2D library you implemented in Part 1. You may also define additional geometric transforms in Art.java, such as sheer, reflect across the x- or y- axis, or rotate about an arbitrary point (as opposed to the origin).
Your program must be organized into at least three separate functions, including main(). All functions except main() must be private.
call…
arrow_forward
How difficult is it to duplicate a collection of shared pointers into another array while using the C++ programming language? Create a list of the several approaches you may use to tackle the issue that has been presented to you. Is it the case that copying a shared pointer also copies the objects that it controls? Explain
arrow_forward
- onl
Answered: Write a progran
Answered: Write a program
Answered: The results from
1 Blended Asse
as.msu.edu.my
msu
college
Blended Assessment System (B
I
&
sity
Part E Question 1 Part E Question 2 Part E Question 3 Part E Question 4 Part E Question 5 Part E Quest
Question 3
Two-dimensional arrays can be initialized when they are declared. Given:
int integer [4] [3]
{{3,2,1}, {4,4,2}, {5,3,0}, {1,0,4}};
Write the for loop to:
(a) Find the total of row 2 of the array.
(b) Find the total of column 1 of the array.
(c) Find the total of each individual row.
(d) Find the total of each individual column.
(e) Initialize column 2 to 0.
[25 Mark]
Please write your answer below:
Source
ABC
BIUS x,
Styles
Format
Font
Size
A-A
hp
liti
arrow_forward
Java code:
The program should ask the users for input and output files.
Question:
Write a code that compares Strassen’s Algorithms and ordinary multiplication.
Include error handling. The output should compare the two algorithms (same output = True or false), each algorithm output should be included, and determine the number of matrix multiplication for each algorithm. Also, what' time and space complexity.
Thank you!
arrow_forward
Program language: C++
A publishing company markets both hardcopy and eBook versions of its work. Create a class publication that stores the title and price of a publication. From this class derive two classes: book, which adds a page count, and digital, which adds a storage capacity in MG bytes. Each of these classes should have a getdata() function to get its data from the user at the keyboard and put a putdata() function to display its data.
Add a base class sales that hold an array of three floats so that it can record the dollar sales of a particular publication for the last three months. Include a getData() function to get three sales amounts from the user and a putdata() function to display the sales figures. Modify the book and digital classes so they are derived from both publication and sales. An object of the class book or digital should input and output sales data along with its other data. Write the main function to create a book object and a digital object and test their…
arrow_forward
Please help me with example five, thank you!
Examples
For examples 1 to 4, you must create the data files with a text tool, such as Notepad
exampleOne
This program reads data from a physical file, create a reference to the file, perform a computation,
display the result,
close the file
package chario;
import java.util.Scanner;
import java.io.*;
//
public class Chario {
//
public static void main(String[] args) throws IOException
{
File file1 = new File("fileOne.txt"); //Create a reference to the physical file
/* Use Notepad to create a text file named fileOne.txt which must be in the same directory that src is in
To find src, open your project in NetBeans and hover its name, which is in the top left just below the Projects menu; this will display the path to your project
My project path is, yours will be different I:\\Ajava\161\WPPractice\IO\charstream\charioMy fileOne.txt is located in chario
*/
Scanner getit = new Scanner( file1…
arrow_forward
java programming language
note
the operations must be stored in a txt file and make read method to read it
The samples are separated with new-line ("\n").
please take your time I would really appreciate the help I am not in a hurry
hank you very much :)
arrow_forward
1. Modify the supplied program template to make an infinite loop that
a) calls code25writer; // display a barcode on the VGA screen
b) waits for a keypress on PB0;
c) calls code25reader; // decode a barcode from the VGA screen
d) waits for a keypress on PB0;
e) repeats from a).
arrow_forward
Python problem
The objective is to build a program that receives a text and formats it in such a way that the text is divided into lines that do not exceed a given size n. In other words, each output line must have a length less than or equal to n, must respect the original order of the words, must include the maximum number of words possible per line, and must include only complete words separated by a space.
EntryA line that contains the text to be divided and an integer n that corresponds to the maximum size of characters per line. n will always be greater than or equal to the size of the longest word in the text plus one. Words in the input text will be separated by one or more blank spaces.
DepartureThe first and last lines must contain a space, n characters "*" and another space at the end. Lines in the requested format must begin and end with the "|" character. The line must be completed before the "|" with spaces
Examples
Input Example 1
In Sumatra, someone wants to get a…
arrow_forward
Language: Java
1. The sample input will have to be in Text File (.TXT)
2. By using the first function, this program reads score and name values from a file. The program then determines the grade for each students by using the second function. Finally, the program displays the name, score, and grade information on the console. The two functions are shown in the images attached below:
arrow_forward
Material
Java/ C++/C- language
Personal Computer.
Instructions:
C. Matrix Transpose
1. The transpose of an m x n matrix A is n x m matrix AT.
2. Formed by interchanging rows into columns and vice versa.
3. (A¹)kj = Aj,k
4.
Let m input to enter the number of rows in the Matrix.
5. Let n input to enter the number of columns in the Matrix.
6.
Display the transpose matrix
7. Save the file TRANSPM
Questions:
1. What do you mean by an array?
2. Differentiate between for loop and while loop.
3. Define transpose of matrix? What will be the order of the matrix AT, if the order of the matrix A
is 4 x 4.
arrow_forward
2. [summary_report.py] Timesheet data is easy to represent in a file, where it can be used to generate a report and help the worker get paid! Given an example
set of data where each row represents a day of the week and each entry on the row represents a block of time worked, like this:
1.5h 3.25h
3.8h 6.Oh 1.eh
5. 5h 2.25h 0.75h
2.25h 3.0h 3.0h
5.75h 2.25h
A report could be produced by a program like this:
0.00h |
5.25h | 1.5en 3.25h 0.5eh
10.00h
0.00h
3.00h 6.00h 1.00h
8.50h
5.50h 2.25h 8.75h
8.25h
8.00h
0.00h | e.00h
2.25h 3.00h 3.00h
5.75h 2.25h
Weekly Total: 40.00h
Notice how in the output file all the numbers are nicely formatted as right-aligned. Hint: you will probably need to use splitting, string slicing, converting data
types, and string formatting.
create a program that uses a data file that you have created, parses the data in that file to create a calculation per row and a running
total, then writes the report to an output file. Your program should prompt a user to input a…
arrow_forward
12. Fibonacci numbers are the numbers in a sequence in which the first three
elements are 0, 1, and 1, and the value of each subsequent element is the sum
of the previous three elements:
0, 1, 1, 2, 4, 7, 13, 24, ...
Write a MATLAB program in a script file that determines and displays the
first 25 Fibonacci numbers.
arrow_forward
Python 3
NO IMPORT PICKLE
Please check the picture and add one more function(def) to display menu and fix the error in the code.
Write a program that keeps names and email addresses in a dictionary as key-value pairs. You Must create and use at least 5 meaningful functions.
A function to display a menu
A function to look up a person’s email address
A function to add a new name and email address
A function to change an email address
A function to delete a name and email address.
This is the Required Output example:
Menu
----------------------------------------
1. Look up an email address
2. Add a new name and email address
3. Change an existing email address
4. Delete a name and email address
5. Quit the program
Enter your choice: 2
Enter name: John
Enter email address: John@yahoo.com
That name already exists
Menu
----------------------------------------
1. Look up an email address
2. Add a new name and email address
3. Change an existing email address
4. Delete a name and…
arrow_forward
ASSEMBLY
It is preferable to pass Arrays by reference when calling subroutines.
True
False
arrow_forward
Create a program to compress and decompress a file. (Files from flashdrive)
Must include or consider the ff:
Data Strutures (list/array/tree/graph)
Time Complexity (choose the best algorithm)
Programming Language can be any of the ff:
Python
Java
C++
C#
C
arrow_forward
please code in python
Forbidden concepts: arrays/lists (data structures), recursion, custom classes
You have been asked to take a small icon that appears on the screen of a smart telephone and scale it up so it looks bigger on a regular computer screen.The icon will be encoded as characters (x and *) in a 3 x 3 grid as follows:
(refer image1 )
Write a program that accepts a positive integer scaling factor and outputs the scaled icon. A scaling factor of k means that each character is replaced by a k X k grid consisting only of that character.
Input Specification:The input will be an integer such that 0 < k ≤ 10.
Output Specification:The output will be 3k lines, which represent each individual line scaled by a factor of k and repeated k times. A line is scaled by a factor of k by replacing each character in the line with k copies of the character.
[refer image2]
arrow_forward
Variables in Bash scripts:
Can be integers, floats and pointers
Natively support Unicode
Expanded within single quotes
Use copy-on-write
Are allocated on stack
arrow_forward
1.How many elements does an array word have? char word[5]
2. It is a type of error that cannot be detected by the compiler. The program will only work but does not do what you intend it to do.
3. This type of c program error occurs when the statement written in the program are not meaningful to the compiler.
4. This error occurs when the data types are incompatible.
5. This error occurs when we do not follow the grammar of the programming language.
arrow_forward
3. Complete the program Student Records that simulates a student records system. The
program reads a list of student ids, names, and GPAS from a file exam.txt, and stores the
information in parallel array lists ids, names, and gpas.
Sample input (exam.txt):
132 Woody 4.1
465 Buzz 3.1
443 Rex 2.8
124 Hamm 3.3
337 Jessie 4.2
Your program will display a GPA report.
You must include a method named reportByGPA (...) that accepts the required array lists
and minimum GPA and displays the list of students that meet the criteria.
Sample output:
Enter the minimum GPA:
4.0
Students with GPA of 4.0 or higher
132 Woody, GPA: 4.1
337 Jessie, GPA: 4.2
end of program
import java.util.ArrayList;
import java.util.Scanner;
import java.io.File;
import java.io.FileNotFoundException;
public class Student Records {
public static void main(String[] args) throws
FileNotFoundException (
Scanner f = new Scanner (new File ("exam.txt"));
Scanner kb = new Scanner (System.in);
ArrayList ids = new ArrayList ();…
arrow_forward
SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education
Related Questions
- 1. Explain what a selection statement is in a sentence or two along with an example. 2. Explain what a loops are in a sentence or two along with an example. 3. Explain what arrays are in a sentence or two along with an example. 4. Give an example that uses selection statements, loops, and arrays together to accomplish an important task. 5. Is it possible to replace a selection statement with a loop? Is it possible to replace a loop with a selection statement? Clearly and concisely argue your position. No hand written and fast answer with explanationarrow_forwardProgram in Java Modify the Ceiling Tile program: • Read from a file the input information (you can use the tile.txt file) • Store the tile size information in arrays • Display to the console the information you read from the file • Display your calculations.arrow_forward5. Design an algorithm that asks the user for the name of a text file containing a grid of numbers and loads it into a 2D array of integers (think like an image without the color channel), then outputs the index (row, col) of the SMALLEST number in the array. Libraries: Input: Output: Design Pattern: Search Find Min Find Max Find All Principal Mechanisms (select all that apply): Single Loop Conditional (if/else) statement Nested Loop split() Indexing / Slicing ☐ input () Process (as a concise and precise LIST OF STEPS/ pseudocode): (Assume libraries have already been imported.)arrow_forward
- InClass Exercise Task01 (V1.0)Requested files: Inclass_Task01.java ( Download)Type of work: Individual workThe Namibia University of Science and Technology would like to introduce an automated student number and email generation system. The system takes into consideration the following: a) To generate the student number it takes three letters(the first, middle and last letter) of the student’s surname and adds it to the first three letters from the first name, then finally adds a three digit postfix number. b) To generate the email is quite easy it just takes the first letter from the first name and adds it to the surname , then it adds the @students.nust.na postfix Your task is to create a program that can achieve the above requirements when given the students surname, first name and three digit postfix through CMD arguements Sample run 1: java InClass01_task01 Kandjeke Jenifer 003 Output: Good day Jenifer welcome to NUST. Your email address is : jkandjeke@students.nust.na Student…arrow_forwardI want to read the text from the file and put it into parallel arrays in c++ For example lest assume following text is in file "i am 17.5" "i am 18.5" "i am 19.5" I want to read this text from the file and put it into parallel arrays so it should have one column for i one for am and one for numbersarrow_forwardProgramming Language: C++ 6. Separate compilation was useful in older programming languages, but having multiple files adds an unnecessary layer of complexity and is discouraged in modern programming languages. = true or false?arrow_forward
- PLEASE WRITE IN JAVA USING ECLIPSE IED Objective: Write a program using the main method where it searches through an array of integer values and prints out the minimum even and odd values. Requirements: Functionality. (20pts) No Syntax Errors. (20pts*) *Code that cannot be compiled due to syntax errors is nonfunctional code and will receive no points for this entire section. User Inputs the size and values of the array. (5pts) The program must ask the user for the size of the array. This value must be strictly greater than zero, otherwise the program must print “Invalid Array Size” and immediately terminate. Otherwise, the program must create an array of integers of that size. The program must ask the user to input each value, and then must store those values into the array. All must apply for full credit. Find the Minimum Even Value. (5pts) The program must then determine the minimum even value found in the array. The program must not assume that the first value in the array is…arrow_forward1 2 3 4 5 programming questions / 1. Find the factors of an interger [Question Description] Writer a program that read an interger and displays all its smallest factors in increasing order. [Input Format] an interger [Output Format] all its smallest factors in increasing order [Input Example] 120 [Output Example] 22235 Submit source files Choose file No file chosen 提交 Note: Programs can only be written in the C++ language. If there are multiple source files, compress them into a rar zip package submission. operation result code not yet submitted Speaking:arrow_forwardjava language coding please Object Relationship and File IO Write a program to perform statistical analysis of scores for a class of students. The class may have up to 40 students.There are five quizzes during the term. Each student is identified by a four-digit student ID number. The program is to print the student scores and calculate and print the statistics for each quiz. The output is in the same order as the input; no sorting is needed. The input is to be read from a text file. The output from the program should be similar to the following: Here is some sample data (not to be used) for calculations: Stud Q1 Q2 Q3 Q4 Q5 1234 78 83 87 91 86 2134 67 77 84 82 79 1852 77 89 93 87 71 High Score 78 89 93 91 86 Low Score 67 77 84 82 71 Average 73.4 83.0 88.2 86.6 78.6 The program should print the lowest and highest scores for each quiz. Plan of Attack Learning Objectives You will apply the following topics in this assignment: File Input operations. Working and…arrow_forward
- Instruction: Create a Java programming code that: Use if-else or switch-case statements.Apply the corresponding looping statement. Program Specification:1. Use two-dimensional array with size 7 columns and 5 rows.2. Seat numbers are populated during run-time and not hard-coded.3. User is asked to input a seat number.4. The chosen seat number is replaced by the letter X.5. Program displays a remark “Seat successfully reserved” when reservation is done. 6. The user is not allowed to reserve a previously reserved seat. Display “Seat istaken” remarks.7. The user is not allowed to enter an invalid seat number. Display an errormessage.8. The program continuously loops. Sample Output: 1 2 3 4 5 6 78 9 10 11 12 13 1415 16 17 18 19 20 2122 23 24 25 26 27 2829 30 31 32 33 34 35Enter seat number to reserve: 111 2 3 4 5 6 78 9 10 X 12 13 1415 16 17 18 19 20 2122 23 24 25 26 27 2829 30 31 32 33 34 35Enter seat number to reserve:arrow_forwardProgramming: C#(C sharp) without using (array, while and furthermore advance loop) Someone i know posted this here already but he got the wrong answer. I was hoping i can get the right one.arrow_forwardAssignment for Computer Architecture: N Factual by Recusion *please have comments in the code* You are to write a program in MIPS that computes N! using recursion. Remember N! is the product of all the numbers from 1 to N inclusive, that is 1 x 2 x 3 x (N – 1) x N. It is defined as 1 for N = 0 and is undefined for values less than 0. The programs first requests the user to input the value of N (display a prompt first so the user knows what to do). If the input value is less than 0, the program is to display “N! undefined for values less than 0” and then requests the user to input the value of N again. If the value input is non-negative, it is to compute N! using a recursive function, that is one that calls itself. You are to have your name, the assignment number, and a brief description of the program in comments at the top of your program. Since this is an assembly language program, I expect to see comments on almost every line of code in the program. Also make the…arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education