1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
laiz [17]
3 years ago
7

Compose a program to examine the string "Hello, world!\n", and calculate the total decimal numeric value of all the characters i

n the string (including punctuation marks), less the numeric value of the vowels.
The program should load each letter, add that numerie value to the running total to produce a total sum, and then add the value to a "vowels running total as well. The program will require a loop. You do not need a counter, since the phrase is null terminated. Remember, punctuation (even spaces!) have a numeric value as well.
Computers and Technology
1 answer:
Ainat [17]3 years ago
6 0

Answer:

.data

  str:   .asciiz   "Hello, world!\n"

  output:   .asciiz "\nTotal character numeric sum = "

.text

.globl main

main:

  la $t0,str       # Load the address of the string

  li $t2,0       # Initialize the total value to zero

loop:   lb $t1,($t0)       # Load one byte at a time from the string

  beqz $t1,end       # If byte is a null character end the operation

  add $t2,$t2,$t1       # Else add the numeric value of the byte to the running total

  addi $t0,$t0,1       # Increment the string pointer by 1

  b loop           # Repeat the loop

end:

  # Displaying the output

  li $v0,4       # Code to print the string

  la $a0,output       # Load the address of the string

  syscall           # Call to print the output string

  li $v0,1       # Code to print the integer

  move $a0,$t2       # Put the value to be printed in $a0

  syscall           # Call to print the integer

  # Exiting the program

  li $v0,10       # Code to exit program

  syscall           # Call to exit the program

Explanation:

You might be interested in
How many iphones have Apple sold in 2019?
Phoenix [80]

Answer:

40.7 million iphones

Explanation:

Gupta. Apple's iPhone sales continued to decline in the third quarter of 2019. Apple sold 40.8 million iPhones, a year-over-year decline of 10.7%.

3 0
3 years ago
Read 2 more answers
If you implement a Wireless LAN (WLAN) to support connectivity for laptops in the Workstation Domain, which domain does WLAN fal
Ira Lisetskai [31]

Answer:

LAN

Explanation:

A LAN ( local area network) is network that is installed with a small area like a building. It can be connected to a WAN or wide area network. The connection between the devices in a LAN network could be with cable (Ethernet protocol) or wireless using WiFi protocol.

The traditional connection in a LAN is with cable, but sometimes, a wireless connection can be used, this is called a WLAN (wireless local area network). Both form of connections are still under the LAN domain.

6 0
3 years ago
Users of an extranet can access a company or organization's entire intranet.
Vlad [161]
True............................I think
7 0
3 years ago
Read 2 more answers
Which error produces incorrect results but does not prevent the program from running?
rusak2 [61]
The logic error produces incorrect results but does not prevent the program from running. The other name for the logic error i<span>n computer programming is bug. When present , this type of error does not terminate (crash) the program, but cause the program to operate incorrectly. Bugs are very hard to find in a program. </span>
4 0
3 years ago
Write a C program that will allow you to add messages to a file that has NO permissions for any user. A Unix system has many fil
amm1812

Answer:

see explaination

Explanation:

#include <iostream>

#include <fstream>

#include <sys/types.h>

#include <sys/stat.h>

#include <time.h>

#include <stdio.h>

#include <stdlib.h>

using namespace std;

int main(int agrc,char*argv[])

{

struct stat sb;

if(agrc != 2){

cout << "invalind command line arguments "<< endl;

return 0;

}

if (stat(argv[1], &sb) == -1) {

perror("stat");

exit(EXIT_FAILURE);

}

if((sb.st_mode & 777) != 0) {

cout<<"file has permission and its invalid"<<endl;

}

//chmod(argv[1], S_IRWXU);

int status = chmod(argv[1], 0200);

if(status){

cout<<"permission sucessfull change"<<endl;

}

ofstream myfile;

myfile.open (argv[1], ios::out | ios::app);

myfile<<argv[2]<<endl;

status = chmod(argv[1], 0000);

if(status){

cout<<"permission sucessfull change

0000"<<endl;

}

myfile.close();

cout << "thank you" << endl;

return 0;

6 0
3 years ago
Other questions:
  • Which device protects computer systems from voltage fluctuations?
    14·2 answers
  • You can use the ____ utility to zero in on the service or other program that is slowing down startup. 1. gpupdate 2. MSconfig 3.
    9·1 answer
  • Consider a binary search tree where each tree node v has a field v.sum which stores the sum of all the keys in the subtree roote
    10·1 answer
  • When you park on a hill, think about which way _____.
    6·2 answers
  • #Electrical Engineering
    13·1 answer
  • Which line of code will create an instance of the pet class?
    13·2 answers
  • Define the following functions related to spreadsheet:<br> a.Consolidate<br> b.Subtotal
    5·1 answer
  • Your computer is taking longer than usual to open files and you notice that your hard drive light stays on longer than usual whi
    9·1 answer
  • Write a paragraph discussing privacy issues on the internet<br> and their impact on human lives.
    9·1 answer
  • Which of the following offers a combination of the features of ram and rom?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!