Question
program in Easy68k only:



2. Input your full access ID (e.g., ab1234, not just 1234) from keyboard in the first line and print the summation of only th
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Since you have not provided the language of your choice, I am providing the code in C++.

CODE

#include <iostream>

using namespace std;

int main() {

char accessId[6];

cout << "My Access ID : ";

cin >> accessId;

int sum = 0;

for (int i=2; i<6; i++) {

sum += accessId[i] - '0';

}

cout << "The sum is: " << sum;

}

clang++-7 -pthread -o main main.cpp #include <iost ream> 1 ./main using namespace std; My Access ID : ab1234 The sum is: 10 3

Add a comment
Know the answer?
Add Answer to:
program in Easy68k only: 2. Input your full access ID (e.g., ab1234, not just 1234) from...
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
  • Compute sum of the four digits in your AccessID and print it out. Please initialize your...

    Compute sum of the four digits in your AccessID and print it out. Please initialize your access ID as input data by using “DC” syntax. Your output should be in this format: My AccessID is ab1234 The sum is 10 Paste your code and screenshot of the output. . . Please create a very, very simple program as I am only a beginner. You don't need to store the four digits as variables. This is what I have so far....

  • C Programming Write a program that meets the following requirements: • Your program will read three...

    C Programming Write a program that meets the following requirements: • Your program will read three integer values from the keyboard. • Your program will output the following data in this order: 1. The third divided by the first if the first is not zero. 2. The third divided by the second if the first is zero and the second is not zero. 3. The sum of the first, second and third values. • All numbers are integers and only...

  • C Program Assignment: 2-Add comments to your program to full document it by describing the most...

    C Program Assignment: 2-Add comments to your program to full document it by describing the most important processes. 3-Your variables names should be very friendly. This means that the names should have meaning related to what they are storing. Example: Instead of naming the variable that stores the hours worked for an employee in a variable called ‘x’ you should name it HoursWorked. 5-Submit your .c program (note that I only need your source code and not all files that...

  • This program will require you to create a basic parser for an input string that is...

    This program will require you to create a basic parser for an input string that is somewhat like Python. Python has an older parser module and a newer ast module to manage pure Python syntax, but they won't be useful here. The program will read a data string, identify the control characters, and print out the overall structure of the string. Here's an example Input String: [{1}] Output: Number inside a dictionary inside a list Here are some basic rules...

  • c++ write a program that reads all values from a text file "data.txt" and stores them in ID array valuesl I. The input process from the file should be terminated when a negative value is detec...

    c++ write a program that reads all values from a text file "data.txt" and stores them in ID array valuesl I. The input process from the file should be terminated when a negative value is detected. (An example of such a file is shown below). Also, the program should copy from values[ 1 any value which has even sum of digits and its index (location) to two new arrays evenArr 1 and idxArrl I, respectively. In addition, the program must...

  • **URGENT** Please help with this MIPS program? (calculator program that uses values from a user's input...

    **URGENT** Please help with this MIPS program? (calculator program that uses values from a user's input file and solves them; needs order of operations) Write a MIPS Assembly Language program to read hexadecimal values and operations (one per line) from a file. The file name should be requested and read in from the console. Once the ascii number has been read in, convert it to internal, binary, storage (decimal). The input format may be either fixed-format, 32-bit, twos compliment values,...

  • ( Object array + input) Write a Java program to meet the following requirements: 1. Define...

    ( Object array + input) Write a Java program to meet the following requirements: 1. Define a class called Student which contains: 1.1 data fields: a. An integer data field contains student id b. Two String data fields named firstname and lastname c. A String data field contains student’s email address 1.2 methods: a. A no-arg constructor that will create a default student object. b. A constructor that creates a student with the specified student id, firstname, lastname and email_address...

  • 1. Perform the following multiplication using Booth’s algorithm: (You will receive full credit only if you...

    1. Perform the following multiplication using Booth’s algorithm: (You will receive full credit only if you show all your work) 13 x-12 (a) Using paper pencil approach and (b)simulate how a machine does this job 2. Perform the following division as directed: (a) 47/4 using non-restoring division alogrithm // we need 4 quotient bits. (b) Using Newton algorithm find 1/d when d=0.84 // show the results of the first 3 iterartions 3. A real-time computer system has a 128 byte...

  • *Java* Given the attached Question class and quiz text, write a driver program to input the...

    *Java* Given the attached Question class and quiz text, write a driver program to input the questions from the text file, print each quiz question, input the character for the answer, and, after all questions, report the results. Write a Quiz class for the driver, with a main method. There should be a Scanner field for the input file, a field for the array of Questions (initialized to 100 possible questions), and an int field for the actual number of...

  • Java programming only Create a Java program that inputs a grade from the user. The grade input from the user will be an...

    Java programming only Create a Java program that inputs a grade from the user. The grade input from the user will be an integer. Once the input is stored, use an if-else-if block of code to determine the letter grade of the inputted integer grade. Do not use a bunch of if statements by themselves to solve this problem. You will print an error message for inputs greater than 100 and for inputs less than 0. Both errors must be...

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
ADVERTISEMENT